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

Unified Diff: mojo/message_pump/message_pump_mojo_unittest.cc

Issue 1552983003: Fix a bunch of mojo_public_*_unittests with the new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/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);

Powered by Google App Engine
This is Rietveld 408576698