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

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

Issue 2429753003: Mojofy unittests: ServiceWorkerJobTest (Closed)
Patch Set: Created 4 years, 2 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 f7620af8bbb1f7265abfea4987587973f6aee493..03da5aa95ffa58beca77a92b9f2b70c600793e7e 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -119,9 +119,10 @@ void EmbeddedWorkerTestHelper::MockEmbeddedWorkerInstanceClient::StopWorker(
ASSERT_TRUE(embedded_worker_id_);
EmbeddedWorkerInstance* worker =
helper_->registry()->GetWorker(embedded_worker_id_.value());
- ASSERT_TRUE(worker != NULL);
- EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, worker->status());
-
+ // |worker| is possible to be null when corresponding EmbeddedWorkerInstance
+ // is removed right after sending StopWorker.
+ if (worker)
+ EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, worker->status());
callback.Run();
}

Powered by Google App Engine
This is Rietveld 408576698