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 885793763ac36db1b83083833b158eb65f89031c..f403d894feaeb22eda23239099df728e0cb796bc 100644 |
--- a/content/browser/service_worker/service_worker_job_unittest.cc |
+++ b/content/browser/service_worker/service_worker_job_unittest.cc |
@@ -584,4 +584,43 @@ TEST_F(ServiceWorkerJobTest, ParallelUnreg) { |
ASSERT_EQ(scoped_refptr<ServiceWorkerRegistration>(), registration); |
} |
+TEST_F(ServiceWorkerJobTest, AbortAll) { |
+ GURL pattern("http://www.example.com/*"); |
+ GURL script_url("http://www.example.com/service_worker.js"); |
+ |
+ bool registration_called = false; |
+ scoped_refptr<ServiceWorkerRegistration> registration; |
+ job_coordinator()->Register( |
+ pattern, |
+ script_url, |
+ render_process_id_, |
+ SaveRegistration(SERVICE_WORKER_ERROR_ABORT, |
+ ®istration_called, ®istration)); |
+ |
+ bool unregistration_called = false; |
+ job_coordinator()->Unregister( |
+ pattern, |
+ SaveUnregistration(SERVICE_WORKER_ERROR_ABORT, |
+ &unregistration_called)); |
+ |
+ ASSERT_FALSE(registration_called); |
+ ASSERT_FALSE(unregistration_called); |
+ job_coordinator()->AbortAll(); |
+ |
+ base::RunLoop().RunUntilIdle(); |
+ ASSERT_TRUE(registration_called); |
+ ASSERT_TRUE(unregistration_called); |
+ |
+ bool find_called = false; |
+ storage()->FindRegistrationForPattern( |
+ pattern, |
+ SaveFoundRegistration( |
+ SERVICE_WORKER_ERROR_NOT_FOUND, &find_called, ®istration)); |
+ |
+ base::RunLoop().RunUntilIdle(); |
+ ASSERT_TRUE(find_called); |
+ ASSERT_EQ(scoped_refptr<ServiceWorkerRegistration>(), registration); |
+} |
+ |
+ |
falken
2014/06/19 03:45:55
extra newline?
nhiroki
2014/06/19 05:53:09
Done.
|
} // namespace content |