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

Unified Diff: net/proxy/proxy_service_mojo_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/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service_mojo_unittest.cc
diff --git a/net/proxy/proxy_service_mojo_unittest.cc b/net/proxy/proxy_service_mojo_unittest.cc
index d49c7d1881c5a07700f41e892342d07483590a23..afa30076cc9e0aa1ed43c59db38e6708eac0ccf6 100644
--- a/net/proxy/proxy_service_mojo_unittest.cc
+++ b/net/proxy/proxy_service_mojo_unittest.cc
@@ -27,10 +27,13 @@
#include "net/proxy/proxy_config_service_fixed.h"
#include "net/proxy/proxy_service.h"
#include "net/test/event_waiter.h"
+#include "net/test/gtest_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
+using net::test::IsOk;
+
namespace net {
namespace {
@@ -167,7 +170,7 @@ TEST_F(ProxyServiceMojoTest, Basic) {
EXPECT_EQ(GURL(kPacUrl), fetcher_->pending_request_url());
fetcher_->NotifyFetchCompletion(OK, kSimplePacScript);
- EXPECT_EQ(OK, callback.WaitForResult());
+ EXPECT_THAT(callback.WaitForResult(), IsOk());
EXPECT_EQ("PROXY foo:1234", info.ToPacString());
EXPECT_EQ(0u, mock_host_resolver_.num_resolve());
proxy_service_.reset();
@@ -189,7 +192,7 @@ TEST_F(ProxyServiceMojoTest, DnsResolution) {
EXPECT_EQ(GURL(kPacUrl), fetcher_->pending_request_url());
fetcher_->NotifyFetchCompletion(OK, kDnsResolvePacScript);
- EXPECT_EQ(OK, callback.WaitForResult());
+ EXPECT_THAT(callback.WaitForResult(), IsOk());
EXPECT_EQ("QUIC bar:4321", info.ToPacString());
EXPECT_EQ(1u, mock_host_resolver_.num_resolve());
proxy_service_.reset();
@@ -223,7 +226,7 @@ TEST_F(ProxyServiceMojoTest, Error) {
network_delegate_.event_waiter().WaitForEvent(
TestNetworkDelegate::PAC_SCRIPT_ERROR);
- EXPECT_EQ(OK, callback.WaitForResult());
+ EXPECT_THAT(callback.WaitForResult(), IsOk());
EXPECT_EQ("DIRECT", info.ToPacString());
EXPECT_EQ(0u, mock_host_resolver_.num_resolve());
@@ -252,7 +255,7 @@ TEST_F(ProxyServiceMojoTest, ErrorOnInitialization) {
network_delegate_.event_waiter().WaitForEvent(
TestNetworkDelegate::PAC_SCRIPT_ERROR);
- EXPECT_EQ(OK, callback.WaitForResult());
+ EXPECT_THAT(callback.WaitForResult(), IsOk());
EXPECT_EQ("DIRECT", info.ToPacString());
EXPECT_EQ(0u, mock_host_resolver_.num_resolve());
« no previous file with comments | « net/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/proxy/proxy_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698