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

Side by Side 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: Update messsages and make unregistration synchronous 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerRegistration.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>Service Worker: Unregistration on detached iframe context</title>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../../resources/testharness-helpers.js"></script>
7 <script src="../resources/test-helpers.js"></script>
8 <script>
9 promise_test(function(t) {
10 var resources_dir = 'resources';
nhiroki 2016/04/21 08:23:30 I think |resources_dir| does not help to reduce th
shimazu 2016/04/21 09:06:36 Done.
11 var url = resources_dir + '/blank.html';
12 var scope_for_iframe = 'unregister-on-detached-iframe'
13 var scope_for_main = resources_dir + '/' + scope_for_iframe;
14 var script = resources_dir + '/empty-worker.js';
15 var frame;
16
17 return service_worker_unregister(t, scope_for_main)
18 .then(function() {
19 return with_iframe(url, {auto_remove: false});
nhiroki 2016/04/21 08:23:30 We could make 'auto_remove' true for the case wher
shimazu 2016/04/21 09:06:36 Done.
20 })
21 .then(function(f) {
22 frame = f;
23 return navigator.serviceWorker.register(script,
24 {scope: scope_for_main});
25 })
26 .then(function(r) {
27 add_completion_callback(function() { r.unregister(); } );
28 return frame.contentWindow.navigator.serviceWorker.getRegistration(
29 scope_for_iframe);
30 })
31 .then(function(r) {
32 frame.remove();
33 return assert_promise_rejects(
34 r.unregister(),
35 'InvalidStateError',
36 'Unregistration on a detached iframe should throw an exception'
37 );
38 });
39 }, 'Unregistration on a detached iframe should fail and throw ' +
40 'InvalidStateError exception');
41 </script>
OLDNEW
« 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