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

Unified Diff: net/cert_net/cert_net_fetcher_impl_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/test_root_certs_unittest.cc ('k') | net/cert_net/nss_ocsp_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert_net/cert_net_fetcher_impl_unittest.cc
diff --git a/net/cert_net/cert_net_fetcher_impl_unittest.cc b/net/cert_net/cert_net_fetcher_impl_unittest.cc
index d8c257b4cb218efa4bcad5125cc5a744f2cade19..4538c400e75bb5cf9ec95e9e99a7bb1b71639732 100644
--- a/net/cert_net/cert_net_fetcher_impl_unittest.cc
+++ b/net/cert_net/cert_net_fetcher_impl_unittest.cc
@@ -16,11 +16,15 @@
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_server_properties_impl.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "net/test/gtest_util.h"
#include "net/url_request/url_request_job_factory_impl.h"
#include "net/url_request/url_request_test_util.h"
+#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+using net::test::IsOk;
+
// TODO(eroman): Test that cookies aren't sent.
using base::ASCIIToUTF16;
@@ -79,7 +83,7 @@ class FetchResult {
: net_error_(net_error), response_body_(response_body) {}
void VerifySuccess(const std::string& expected_body) {
- EXPECT_EQ(OK, net_error_);
+ EXPECT_THAT(net_error_, IsOk());
EXPECT_EQ(expected_body,
std::string(response_body_.begin(), response_body_.end()));
}
« no previous file with comments | « net/cert/test_root_certs_unittest.cc ('k') | net/cert_net/nss_ocsp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698