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

Unified Diff: content/browser/service_worker/embedded_worker_test_helper.cc

Issue 1342733002: ServiceWorker: log when the script's loaded separately from thread start (chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 5 years, 3 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/service_worker/embedded_worker_test_helper.cc
diff --git a/content/browser/service_worker/embedded_worker_test_helper.cc b/content/browser/service_worker/embedded_worker_test_helper.cc
index 8f9d4da2cf427bd3d46eb86ffcfd5926392b510d..887a95f050642e4ae16c7abda71ed423d325ad38 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -114,7 +114,8 @@ void EmbeddedWorkerTestHelper::OnStartWorker(int embedded_worker_id,
service_worker_version_id;
SimulateWorkerReadyForInspection(embedded_worker_id);
SimulateWorkerScriptCached(embedded_worker_id);
- SimulateWorkerScriptLoaded(next_thread_id_++, embedded_worker_id);
+ SimulateWorkerScriptLoaded(embedded_worker_id);
+ SimulateWorkerThreadStarted(next_thread_id_++, embedded_worker_id);
SimulateWorkerScriptEvaluated(embedded_worker_id);
SimulateWorkerStarted(embedded_worker_id);
}
@@ -207,11 +208,19 @@ void EmbeddedWorkerTestHelper::SimulateWorkerScriptCached(
}
void EmbeddedWorkerTestHelper::SimulateWorkerScriptLoaded(
- int thread_id, int embedded_worker_id) {
+ int embedded_worker_id) {
EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id);
ASSERT_TRUE(worker != NULL);
- registry()->OnWorkerScriptLoaded(
- worker->process_id(), thread_id, embedded_worker_id);
+ registry()->OnWorkerScriptLoaded(worker->process_id(), embedded_worker_id);
+}
+
+void EmbeddedWorkerTestHelper::SimulateWorkerThreadStarted(
+ int thread_id,
+ int embedded_worker_id) {
+ EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id);
+ ASSERT_TRUE(worker != NULL);
+ registry()->OnWorkerThreadStarted(worker->process_id(), thread_id,
+ embedded_worker_id);
}
void EmbeddedWorkerTestHelper::SimulateWorkerScriptEvaluated(

Powered by Google App Engine
This is Rietveld 408576698