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

Unified Diff: content/browser/shared_worker/shared_worker_service_impl_unittest.cc

Issue 196503005: Make DevTools support for the embedded SharedWorker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: introduce WorkerState enum and add test Created 6 years, 9 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: 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()
kinuko 2014/04/01 16:01:05 nit: please end comment with '.' (here and below)
horo 2014/04/02 04:31:57 Done.
+ 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.

Powered by Google App Engine
This is Rietveld 408576698