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

Unified Diff: net/proxy/proxy_resolver_factory_mojo_unittest.cc

Issue 2096293002: Eliminate usage of InterfacePtr::WaitForIncomingResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « mash/catalog_viewer/catalog_viewer.cc ('k') | services/catalog/public/interfaces/catalog.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_factory_mojo_unittest.cc
diff --git a/net/proxy/proxy_resolver_factory_mojo_unittest.cc b/net/proxy/proxy_resolver_factory_mojo_unittest.cc
index 364462a8330caa187edca2154fe38e948adea731..b7d1a549080bb743bc423a87fcc7a9fc3b819da7 100644
--- a/net/proxy/proxy_resolver_factory_mojo_unittest.cc
+++ b/net/proxy/proxy_resolver_factory_mojo_unittest.cc
@@ -267,7 +267,10 @@ void MockMojoProxyResolver::GetProxyForUrl(
break;
}
case GetProxyForUrlAction::WAIT_FOR_CLIENT_DISCONNECT: {
- ASSERT_FALSE(client.WaitForIncomingResponse());
+ base::RunLoop run_loop;
+ client.set_connection_error_handler(run_loop.QuitClosure());
+ run_loop.Run();
+ ASSERT_TRUE(client.encountered_error());
leonhsl(Using Gerrit) 2016/06/27 11:03:16 I think InterfacePtr would detect the connection e
yzshen1 2016/06/29 21:36:20 Please look at base::MessageLoop::ScopedNestableTa
leonhsl(Using Gerrit) 2016/06/29 22:53:49 Yeah I noticed the multiple layers of base::RunLoo
leonhsl(Using Gerrit) 2016/07/01 08:53:50 Done.
break;
}
case GetProxyForUrlAction::MAKE_DNS_REQUEST: {
@@ -430,7 +433,10 @@ void MockMojoProxyResolverFactory::CreateResolver(
break;
}
case CreateProxyResolverAction::WAIT_FOR_CLIENT_DISCONNECT: {
- ASSERT_FALSE(client.WaitForIncomingResponse());
+ base::RunLoop run_loop;
+ client.set_connection_error_handler(run_loop.QuitClosure());
+ run_loop.RunUntilIdle();
yzshen1 2016/06/29 21:36:20 Please note that RunUntilIdle is incorrect. The me
leonhsl(Using Gerrit) 2016/06/29 22:53:49 Understood.
leonhsl(Using Gerrit) 2016/07/01 08:53:50 Done.
+ ASSERT_TRUE(client.encountered_error());
break;
}
case CreateProxyResolverAction::MAKE_DNS_REQUEST: {
« no previous file with comments | « mash/catalog_viewer/catalog_viewer.cc ('k') | services/catalog/public/interfaces/catalog.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698