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

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

Issue 385143002: ServiceWorker: Stop a worker thread on unregistration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: modify unittests Created 6 years, 5 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_job_unittest.cc
diff --git a/content/browser/service_worker/service_worker_job_unittest.cc b/content/browser/service_worker/service_worker_job_unittest.cc
index 514d34b3edfb7da6f621fee8046fd0a2631122c1..3076b1e06485bfd4f948838567c55572b9ad8953 100644
--- a/content/browser/service_worker/service_worker_job_unittest.cc
+++ b/content/browser/service_worker/service_worker_job_unittest.cc
@@ -735,8 +735,9 @@ TEST_F(ServiceWorkerJobTest, UnregisterWaitingSetsRedundant) {
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(called);
- EXPECT_EQ(ServiceWorkerVersion::RUNNING,
- version->running_status());
+ // The version should be stopped since there is no controllee after
+ // unregistration.
+ EXPECT_EQ(ServiceWorkerVersion::STOPPED, version->running_status());
EXPECT_EQ(ServiceWorkerVersion::REDUNDANT, version->status());
}
@@ -764,7 +765,9 @@ TEST_F(ServiceWorkerJobTest, UnregisterActiveSetsRedundant) {
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(called);
- EXPECT_EQ(ServiceWorkerVersion::RUNNING, version->running_status());
+ // The version should be stopped since there is no controllee after
+ // unregistration.
+ EXPECT_EQ(ServiceWorkerVersion::STOPPED, version->running_status());
EXPECT_EQ(ServiceWorkerVersion::REDUNDANT, version->status());
}
@@ -800,12 +803,15 @@ TEST_F(ServiceWorkerJobTest,
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(called);
+ // The version should be running since there is still a controllee.
EXPECT_EQ(ServiceWorkerVersion::RUNNING, version->running_status());
EXPECT_EQ(ServiceWorkerVersion::ACTIVATED, version->status());
registration->active_version()->RemoveControllee(host.get());
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(ServiceWorkerVersion::RUNNING, version->running_status());
+
+ // The version should be stopped since there is no controllee.
+ EXPECT_EQ(ServiceWorkerVersion::STOPPED, version->running_status());
EXPECT_EQ(ServiceWorkerVersion::REDUNDANT, version->status());
}
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698