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

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

Issue 2429753003: Mojofy unittests: ServiceWorkerJobTest (Closed)
Patch Set: Check if mojo is enabled when creating a mock interface 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 d3ae532f6dc71979c0e754a6a3133879a119cdfe..ac19d955c72a9d34bd43149eb0b05a9e4b1838b8 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -123,9 +123,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