Index: content/browser/shared_worker/shared_worker_service_impl_unittest.cc |
diff --git a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc |
index 112b8e83a08eceeec52be71baf1e59586db52a53..ad797b2d9d0c92d06cad2c288bc33df6e7ab6385 100644 |
--- a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc |
+++ b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc |
@@ -20,6 +20,7 @@ |
#include "content/common/worker_messages.h" |
#include "content/public/test/test_browser_context.h" |
#include "content/public/test/test_browser_thread_bundle.h" |
+#include "content/public/test/test_utils.h" |
#include "ipc/ipc_sync_message.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -356,6 +357,9 @@ TEST_F(SharedWorkerServiceImplTest, BasicTest) { |
// SharedWorkerConnector creates two message ports and sends |
// ViewHostMsg_CreateWorker. |
connector->Create("http://example.com/w.js", "name", 200, 300); |
+ // We need to go to UI thread to call |
+ // SharedWorkerDevToolsManager::WorkerCreated() |
+ RunAllPendingInMessageLoop(); |
EXPECT_EQ(2U, renderer_host->QueuedMessageCount()); |
// WorkerProcessMsg_CreateWorker should be sent to the renderer in which |
// SharedWorker will be created. |
@@ -441,6 +445,9 @@ TEST_F(SharedWorkerServiceImplTest, TwoRendererTest) { |
// SharedWorkerConnector creates two message ports and sends |
// ViewHostMsg_CreateWorker. |
connector1->Create("http://example.com/w.js", "name", 200, 300); |
+ // We need to go to UI thread to call |
+ // SharedWorkerDevToolsManager::WorkerCreated() |
+ RunAllPendingInMessageLoop(); |
EXPECT_EQ(2U, renderer_host1->QueuedMessageCount()); |
// WorkerProcessMsg_CreateWorker should be sent to the renderer in which |
// SharedWorker will be created. |