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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/reclaim-registration-after-iframe-deletion.html

Issue 1893363003: ServiceWorker: Refer to the current provider in ServiceWorkerRegistration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/reclaim-registration-after-iframe-deletion.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/reclaim-registration-after-iframe-deletion.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/reclaim-registration-after-iframe-deletion.html
new file mode 100644
index 0000000000000000000000000000000000000000..2a9bee6d2b7045d594eb94f22b4a84ea91666557
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/reclaim-registration-after-iframe-deletion.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Service Worker: Reclaiming registration after removal of iframe</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 = 'resources/reclam-registration-after-iframe-deletion';
nhiroki 2016/04/20 03:42:16 s/reclam/reclaim/ BTW, "reclaim-registration" mig
shimazu 2016/04/21 03:57:50 Done.
+ var script = 'resources/empty-worker.js';
+ var frame;
+ var registration;
+
+ return service_worker_unregister(t, scope)
+ .then(function() {
+ return with_iframe(url, {auto_remove: false});
+ })
+ .then(function(f) {
+ frame = f;
+ return frame.contentWindow.navigator.serviceWorker.register(
+ script,
+ { scope: scope });
+ })
+ .then(function(r) {
+ add_completion_callback(
+ service_worker_unregister.bind(null, t, scope));
nhiroki 2016/04/20 03:42:15 This couldn't work because "service_worker_unregis
shimazu 2016/04/21 03:57:50 Done.
+ registration = r;
+ frame.remove();
+ })
+ .then(function() {
nhiroki 2016/04/20 03:42:16 Maybe we don't have to separate these operations i
shimazu 2016/04/21 03:57:50 Done.
+ return assert_promise_rejects(
nhiroki 2016/04/20 03:42:16 'return' is not necessary.
shimazu 2016/04/21 03:57:50 assert_promise_rejects() returns Promise object co
nhiroki 2016/04/21 08:23:30 Ah, sorry! I wrongly assumed that assert_promise_r
+ registration.unregister(),
+ 'InvalidStateError',
+ 'Unregistration on a detached iframe should throw an exception'
+ );
+ });
+ }, 'unregistration to should be finished successfully');
nhiroki 2016/04/20 03:42:16 There is an extra space between "to" and "should".
shimazu 2016/04/21 03:57:50 Done.
+</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