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

Unified Diff: mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc

Issue 2096293002: Eliminate usage of InterfacePtr::WaitForIncomingResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybots failure Created 4 years, 5 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
Index: mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc b/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
index 4d3a93ea6eb05185b1b7a04ebcd055f03adace53..aff625116863453f96ab36e88f1ed968336703bb 100644
--- a/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
@@ -59,10 +59,6 @@ class MathCalculatorUI {
: calculator_(std::move(calculator)),
output_(0.0) {}
- bool WaitForIncomingResponse() {
- return calculator_.WaitForIncomingResponse();
- }
-
bool encountered_error() const { return calculator_.encountered_error(); }
void set_connection_error_handler(const base::Closure& closure) {
calculator_.set_connection_error_handler(closure);
@@ -251,16 +247,18 @@ TEST_F(InterfacePtrTest, EndToEnd_Synchronous) {
EXPECT_EQ(0.0, calculator_ui.GetOutput());
- calculator_ui.Add(2.0, base::Closure());
+ base::RunLoop run_loop;
+ calculator_ui.Add(2.0, run_loop.QuitClosure());
EXPECT_EQ(0.0, calculator_ui.GetOutput());
calc_impl.WaitForIncomingMethodCall();
- calculator_ui.WaitForIncomingResponse();
+ run_loop.Run();
EXPECT_EQ(2.0, calculator_ui.GetOutput());
- calculator_ui.Multiply(5.0, base::Closure());
+ base::RunLoop run_loop2;
+ calculator_ui.Multiply(5.0, run_loop2.QuitClosure());
EXPECT_EQ(2.0, calculator_ui.GetOutput());
calc_impl.WaitForIncomingMethodCall();
- calculator_ui.WaitForIncomingResponse();
+ run_loop2.Run();
EXPECT_EQ(10.0, calculator_ui.GetOutput());
}
« no previous file with comments | « mojo/public/cpp/bindings/lib/interface_ptr_state.h ('k') | net/proxy/proxy_resolver_factory_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698