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

Unified Diff: net/proxy/mojo_proxy_resolver_factory_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/proxy/dhcp_proxy_script_fetcher_win_unittest.cc ('k') | net/proxy/mojo_proxy_resolver_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/mojo_proxy_resolver_factory_impl_unittest.cc
diff --git a/net/proxy/mojo_proxy_resolver_factory_impl_unittest.cc b/net/proxy/mojo_proxy_resolver_factory_impl_unittest.cc
index a3c6216d9074a09927dbfdfb7c466ceb5c4ac4b6..65b315107f53914181979c1d0794f9406137bea7 100644
--- a/net/proxy/mojo_proxy_resolver_factory_impl_unittest.cc
+++ b/net/proxy/mojo_proxy_resolver_factory_impl_unittest.cc
@@ -13,8 +13,13 @@
#include "net/proxy/mock_proxy_resolver.h"
#include "net/proxy/proxy_resolver_v8_tracing.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"
+using net::test::IsError;
+using net::test::IsOk;
+
namespace net {
namespace {
@@ -152,7 +157,7 @@ TEST_F(MojoProxyResolverFactoryImplTest, DisconnectProxyResolverClient) {
&MojoProxyResolverFactoryImplTest::OnFakeProxyInstanceDestroyed,
base::Unretained(this))));
mock_factory_->pending_request()->callback.Run(OK);
- EXPECT_EQ(OK, create_callback.WaitForResult());
+ EXPECT_THAT(create_callback.WaitForResult(), IsOk());
proxy_resolver.reset();
waiter_.WaitForEvent(RESOLVER_DESTROYED);
EXPECT_EQ(1, instances_destroyed_);
@@ -176,7 +181,7 @@ TEST_F(MojoProxyResolverFactoryImplTest, Error) {
create_callback_ = create_callback.callback();
ASSERT_TRUE(mock_factory_->pending_request());
mock_factory_->pending_request()->callback.Run(ERR_PAC_SCRIPT_FAILED);
- EXPECT_EQ(ERR_PAC_SCRIPT_FAILED, create_callback.WaitForResult());
+ EXPECT_THAT(create_callback.WaitForResult(), IsError(ERR_PAC_SCRIPT_FAILED));
}
TEST_F(MojoProxyResolverFactoryImplTest,
« no previous file with comments | « net/proxy/dhcp_proxy_script_fetcher_win_unittest.cc ('k') | net/proxy/mojo_proxy_resolver_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698