Chromium Code Reviews| Index: ios/web/webui/web_ui_mojo_inttest.mm |
| diff --git a/ios/web/webui/web_ui_mojo_inttest.mm b/ios/web/webui/web_ui_mojo_inttest.mm |
| index 64a3d1ea39bf64c7f3ca406ac382f0137b4d323b..ae881f143eba665cdcdc261259350957a85684a0 100644 |
| --- a/ios/web/webui/web_ui_mojo_inttest.mm |
| +++ b/ios/web/webui/web_ui_mojo_inttest.mm |
| @@ -7,6 +7,7 @@ |
| #include "base/memory/ptr_util.h" |
| #include "base/run_loop.h" |
| #import "base/test/ios/wait_util.h" |
| +#include "base/threading/thread_task_runner_handle.h" |
| #import "ios/web/public/navigation_manager.h" |
| #include "ios/web/public/web_ui_ios_data_source.h" |
| #include "ios/web/public/webui/web_ui_ios_controller.h" |
| @@ -161,7 +162,16 @@ TEST_F(WebUIMojoTest, MessageExchange) { |
| // Wait until |TestUIHandler| receives "ack" message from WebUI page. |
| base::test::ios::WaitUntilCondition(^{ |
| - base::RunLoop().RunUntilIdle(); |
| + // Flush any pending tasks. Don't RunUntilIdle() because |
| + // RunUntilIdle() is incompatible with mojo::SimpleWatcher's |
| + // automatic arming behavior, which Mojo JS still depends upon. |
| + // |
| + // TODO(rockot): Introduce the full watcher API to JS and get rid |
|
Eugene But (OOO till 7-30)
2017/03/15 17:56:34
On ios we use TODO(crbug.com/###): format, because
Ken Rockot(use gerrit already)
2017/03/15 22:59:33
Seems reasonable. I've filed a bug and updated the
|
| + // of this hack. |
| + base::RunLoop loop; |
| + base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| + loop.QuitClosure()); |
| + loop.Run(); |
| return test_ui_handler()->IsFinReceived(); |
| }); |
| } |