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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/unregister-on-detached-iframe.html

Issue 1893363003: ServiceWorker: Refer to the current provider in ServiceWorkerRegistration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 | third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/unregister-on-detached-iframe.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/unregister-on-detached-iframe.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/unregister-on-detached-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..408037e08cffda24461105ddab44c1816bb7ebee
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/unregister-on-detached-iframe.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Service Worker: Unregistration on detached iframe context</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../../resources/testharness-helpers.js"></script>
+<script src="../resources/test-helpers.js"></script>
+<script>
+promise_test(function(t) {
+ var url = './resources/blank.html';
+ var scope_for_iframe = './unregister-on-detached-iframe'
+ var scope_for_main = './resources/' + scope_for_iframe;
+ var script = './resources/empty-worker.js';
+ var frame;
+
+ return service_worker_unregister(t, scope_for_main)
+ .then(function() {
+ return with_iframe(url);
+ })
+ .then(function(f) {
+ frame = f;
+ return navigator.serviceWorker.register(script,
+ {scope: scope_for_main});
+ })
+ .then(function(r) {
+ add_completion_callback(function() { r.unregister(); } );
+ return frame.contentWindow.navigator.serviceWorker.getRegistration(
+ scope_for_iframe);
+ })
+ .then(function(r) {
+ frame.remove();
+ return promise_rejects(t, 'InvalidStateError', r.unregister());
+ });
+ }, 'Unregistration on a detached iframe should fail and throw ' +
+ 'InvalidStateError exception');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698