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

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

Issue 2056153002: Convert PageLoadMetrics to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/interface_ptr_state.h ('k') | tools/ipc_fuzzer/message_lib/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 aff625116863453f96ab36e88f1ed968336703bb..cf898973a672f6aa82f71632174120b13e3b407a 100644
--- a/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
@@ -59,6 +59,10 @@ 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);
@@ -191,9 +195,9 @@ class IntegerAccessorImpl : public sample::IntegerAccessor {
class InterfacePtrTest : public testing::Test {
public:
InterfacePtrTest() {}
- ~InterfacePtrTest() override { base::RunLoop().RunUntilIdle(); }
+ ~InterfacePtrTest() override { loop_.RunUntilIdle(); }
- void PumpMessages() { base::RunLoop().RunUntilIdle(); }
+ void PumpMessages() { loop_.RunUntilIdle(); }
private:
base::MessageLoop loop_;
@@ -247,18 +251,16 @@ TEST_F(InterfacePtrTest, EndToEnd_Synchronous) {
EXPECT_EQ(0.0, calculator_ui.GetOutput());
- base::RunLoop run_loop;
- calculator_ui.Add(2.0, run_loop.QuitClosure());
+ calculator_ui.Add(2.0, base::Closure());
EXPECT_EQ(0.0, calculator_ui.GetOutput());
calc_impl.WaitForIncomingMethodCall();
- run_loop.Run();
+ calculator_ui.WaitForIncomingResponse();
EXPECT_EQ(2.0, calculator_ui.GetOutput());
- base::RunLoop run_loop2;
- calculator_ui.Multiply(5.0, run_loop2.QuitClosure());
+ calculator_ui.Multiply(5.0, base::Closure());
EXPECT_EQ(2.0, calculator_ui.GetOutput());
calc_impl.WaitForIncomingMethodCall();
- run_loop2.Run();
+ calculator_ui.WaitForIncomingResponse();
EXPECT_EQ(10.0, calculator_ui.GetOutput());
}
« no previous file with comments | « mojo/public/cpp/bindings/lib/interface_ptr_state.h ('k') | tools/ipc_fuzzer/message_lib/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698