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

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

Issue 377153003: Service Worker: set active worker to REDUNDANT when unregistered (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make setting redundant clearly the responsibility of SWStorage 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
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 b1054ba7ba731699f14d6d450d0969672ccaa693..7918872ccf730974a40cda4da56fb0537cb366ca 100644
--- a/content/browser/service_worker/service_worker_job_unittest.cc
+++ b/content/browser/service_worker/service_worker_job_unittest.cc
@@ -700,44 +700,4 @@ TEST_F(ServiceWorkerJobTest, AbortAll_RegUnreg) {
EXPECT_EQ(scoped_refptr<ServiceWorkerRegistration>(), registration);
}
-// Tests that the waiting worker enters the 'redundant' state upon
-// unregistration.
-TEST_F(ServiceWorkerJobTest, UnregisterSetsRedundant) {
- scoped_refptr<ServiceWorkerRegistration> registration;
- bool called = false;
- job_coordinator()->Register(
- GURL("http://www.example.com/*"),
- GURL("http://www.example.com/service_worker.js"),
- render_process_id_,
- SaveRegistration(SERVICE_WORKER_OK, &called, &registration));
- base::RunLoop().RunUntilIdle();
- ASSERT_TRUE(called);
- ASSERT_TRUE(registration);
-
- // Manually create the waiting worker since there is no way to become a
- // waiting worker until Update is implemented.
- scoped_refptr<ServiceWorkerVersion> version = new ServiceWorkerVersion(
- registration, 1L, helper_->context()->AsWeakPtr());
- ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED;
- version->StartWorker(CreateReceiverOnCurrentThread(&status));
- base::RunLoop().RunUntilIdle();
- ASSERT_EQ(SERVICE_WORKER_OK, status);
-
- version->SetStatus(ServiceWorkerVersion::INSTALLED);
- registration->SetWaitingVersion(version);
- EXPECT_EQ(ServiceWorkerVersion::RUNNING,
- version->running_status());
- EXPECT_EQ(ServiceWorkerVersion::INSTALLED, version->status());
-
- called = false;
- job_coordinator()->Unregister(GURL("http://www.example.com/*"),
- SaveUnregistration(SERVICE_WORKER_OK, &called));
- base::RunLoop().RunUntilIdle();
- ASSERT_TRUE(called);
-
- EXPECT_EQ(ServiceWorkerVersion::RUNNING,
- version->running_status());
- EXPECT_EQ(ServiceWorkerVersion::REDUNDANT, version->status());
-}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698