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

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

Issue 1381153004: Service Worker: Change the criteria for bumping the last update check time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update the unittest. Created 5 years 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 5cbc11aa40c2b7c1c2e81e63c21de2126932f2bb..3076bf7c3c6040fe09c1e1fb27c876d0a7ce0c45 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -140,10 +140,24 @@ void EmbeddedWorkerTestHelper::OnStartWorker(int embedded_worker_id,
SimulateWorkerScriptCached(embedded_worker_id);
SimulateWorkerScriptLoaded(embedded_worker_id);
SimulateWorkerThreadStarted(next_thread_id_++, embedded_worker_id);
- SimulateWorkerScriptEvaluated(embedded_worker_id);
+ SimulateWorkerScriptEvaluated(embedded_worker_id, true /* success */);
SimulateWorkerStarted(embedded_worker_id);
}
+void EmbeddedWorkerTestHelper::OnStartWorkerFailed(
+ int embedded_worker_id,
+ int64 service_worker_version_id,
+ const GURL& scope,
+ const GURL& script_url) {
+ embedded_worker_id_service_worker_version_id_map_[embedded_worker_id] =
+ service_worker_version_id;
+ SimulateWorkerReadyForInspection(embedded_worker_id);
+ SimulateWorkerScriptCached(embedded_worker_id);
+ SimulateWorkerScriptLoaded(embedded_worker_id);
+ SimulateWorkerThreadStarted(next_thread_id_++, embedded_worker_id);
+ SimulateWorkerScriptEvaluated(embedded_worker_id, false /* failure */);
+}
+
void EmbeddedWorkerTestHelper::OnStopWorker(int embedded_worker_id) {
// By default just notify the sender that the worker is stopped.
SimulateWorkerStopped(embedded_worker_id);
@@ -248,11 +262,12 @@ void EmbeddedWorkerTestHelper::SimulateWorkerThreadStarted(
}
void EmbeddedWorkerTestHelper::SimulateWorkerScriptEvaluated(
- int embedded_worker_id) {
+ int embedded_worker_id,
+ bool success) {
EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id);
ASSERT_TRUE(worker != NULL);
- registry()->OnWorkerScriptEvaluated(
- worker->process_id(), embedded_worker_id, true /* success */);
+ registry()->OnWorkerScriptEvaluated(worker->process_id(), embedded_worker_id,
+ success);
}
void EmbeddedWorkerTestHelper::SimulateWorkerStarted(

Powered by Google App Engine
This is Rietveld 408576698