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

Unified Diff: LayoutTests/http/tests/serviceworker/unregister-controller.html

Issue 416003003: Test for register canceling an unregister. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: mostly formatting fix Created 6 years, 4 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: LayoutTests/http/tests/serviceworker/unregister-controller.html
diff --git a/LayoutTests/http/tests/serviceworker/unregister-controller.html b/LayoutTests/http/tests/serviceworker/unregister-controller.html
index 4939a3c29c4de40a316f7d25b64e380e414d5934..c3394fe059341e3f8120071e6e35ecebff9773c7 100644
--- a/LayoutTests/http/tests/serviceworker/unregister-controller.html
+++ b/LayoutTests/http/tests/serviceworker/unregister-controller.html
@@ -68,4 +68,30 @@ async_test(function(t) {
})
.catch(unreached_rejection(t));
}, 'Unregister prevents control of subsequent navigations');
+
+async_test(function(t) {
+ var scope =
+ 'scope/no-new-controllee-even-if-registration-is-still-used';
+
+ service_worker_unregister_and_register(t, worker_url, scope)
+ .then(function(registered_worker) {
+ return wait_for_state(t, registered_worker, 'activated');
+ })
+ .then(function() {
+ return with_iframe(scope);
+ })
+ .then(function(frame) {
+ return navigator.serviceWorker.unregister(scope);
+ })
+ .then(function() {
+ return with_iframe(scope);
+ })
+ .then(function(frame) {
+ assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
+ null,
+ 'document should not have a controller');
+ t.done();
+ })
+ .catch(unreached_rejection(t));
+ }, 'Unregister prevents new controllee even if registration is still in use');
</script>

Powered by Google App Engine
This is Rietveld 408576698