Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: net/cert_net/nss_ocsp_unittest.cc

Issue 2109503009: Refactor net tests to use GMock matchers for checking net::Error results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to contents.txt files Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert_net/cert_net_fetcher_impl_unittest.cc ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert_net/nss_ocsp_unittest.cc
diff --git a/net/cert_net/nss_ocsp_unittest.cc b/net/cert_net/nss_ocsp_unittest.cc
index c5a1e61766f13fed22597a3f863456706fff6ffc..8dca371eee1ac58bc3dd9f75eb68f852e5290dd6 100644
--- a/net/cert_net/nss_ocsp_unittest.cc
+++ b/net/cert_net/nss_ocsp_unittest.cc
@@ -23,13 +23,18 @@
#include "net/cert/test_root_certs.h"
#include "net/cert/x509_certificate.h"
#include "net/test/cert_test_util.h"
+#include "net/test/gtest_util.h"
#include "net/test/test_data_directory.h"
#include "net/url_request/url_request_filter.h"
#include "net/url_request/url_request_interceptor.h"
#include "net/url_request/url_request_test_job.h"
#include "net/url_request/url_request_test_util.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+using net::test::IsError;
+using net::test::IsOk;
+
namespace net {
namespace {
@@ -148,11 +153,11 @@ TEST_F(NssHttpTest, TestAia) {
std::string(), CertificateList()),
nullptr, &verify_result, test_callback.callback(), &request,
BoundNetLog());
- ASSERT_EQ(ERR_IO_PENDING, error);
+ ASSERT_THAT(error, IsError(ERR_IO_PENDING));
error = test_callback.WaitForResult();
- EXPECT_EQ(OK, error);
+ EXPECT_THAT(error, IsOk());
// Ensure that NSS made an AIA request for the missing intermediate.
EXPECT_LT(0, request_count());
« no previous file with comments | « net/cert_net/cert_net_fetcher_impl_unittest.cc ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698