Chromium Code Reviews| Index: mojo/message_pump/message_pump_mojo_unittest.cc |
| diff --git a/mojo/message_pump/message_pump_mojo_unittest.cc b/mojo/message_pump/message_pump_mojo_unittest.cc |
| index 68e40df5eda5aeb6f25659772c426348a2cf2f10..511038a890c7a85dbdd2fde95add87fd722cb05d 100644 |
| --- a/mojo/message_pump/message_pump_mojo_unittest.cc |
| +++ b/mojo/message_pump/message_pump_mojo_unittest.cc |
| @@ -69,6 +69,10 @@ TEST(MessagePumpMojo, RunUntilIdle) { |
| handles.handle1.get(), NULL, 0, NULL, 0, MOJO_WRITE_MESSAGE_FLAG_NONE); |
| WriteMessageRaw( |
| handles.handle1.get(), NULL, 0, NULL, 0, MOJO_WRITE_MESSAGE_FLAG_NONE); |
| + MojoHandleSignalsState hss; |
| + ASSERT_EQ(MOJO_RESULT_OK, |
| + MojoWait(handles.handle0.get().value(), MOJO_HANDLE_SIGNAL_READABLE, |
| + MOJO_DEADLINE_INDEFINITE, &hss)); |
| base::RunLoop run_loop; |
| run_loop.RunUntilIdle(); |
|
yzshen1
2016/01/04 18:54:25
Even when we wait till the handle is readable, it
jam
2016/01/04 21:00:06
good point. I've switched these tests to use callb
|
| EXPECT_EQ(2, handler.success_count()); |
| @@ -88,7 +92,12 @@ TEST(MessagePumpMojo, Observer) { |
| base::TimeTicks()); |
| WriteMessageRaw( |
| handles.handle1.get(), NULL, 0, NULL, 0, MOJO_WRITE_MESSAGE_FLAG_NONE); |
| - base::RunLoop run_loop; |
| + |
| + MojoHandleSignalsState hss; |
| + ASSERT_EQ(MOJO_RESULT_OK, |
| + MojoWait(handles.handle0.get().value(), MOJO_HANDLE_SIGNAL_READABLE, |
| + MOJO_DEADLINE_INDEFINITE, &hss)); |
| + base::RunLoop run_loop; |
| run_loop.RunUntilIdle(); |
| EXPECT_EQ(1, handler.success_count()); |
| EXPECT_EQ(1, observer.will_signal_handler_count); |
| @@ -97,7 +106,10 @@ TEST(MessagePumpMojo, Observer) { |
| WriteMessageRaw( |
| handles.handle1.get(), NULL, 0, NULL, 0, MOJO_WRITE_MESSAGE_FLAG_NONE); |
| - base::RunLoop run_loop2; |
| + ASSERT_EQ(MOJO_RESULT_OK, |
| + MojoWait(handles.handle0.get().value(), MOJO_HANDLE_SIGNAL_READABLE, |
| + MOJO_DEADLINE_INDEFINITE, &hss)); |
| + base::RunLoop run_loop2; |
| run_loop2.RunUntilIdle(); |
| EXPECT_EQ(2, handler.success_count()); |
| EXPECT_EQ(1, observer.will_signal_handler_count); |