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

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: Use promise_rejects instead of assert_promise_rejects 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 url = './resources/blank.html';
11 var scope_for_iframe = './unregister-on-detached-iframe'
12 var scope_for_main = './resources/' + scope_for_iframe;
13 var script = './resources/empty-worker.js';
14 var frame;
15
16 return service_worker_unregister(t, scope_for_main)
17 .then(function() {
18 return with_iframe(url);
19 })
20 .then(function(f) {
21 frame = f;
22 return navigator.serviceWorker.register(script,
23 {scope: scope_for_main});
24 })
25 .then(function(r) {
26 add_completion_callback(function() { r.unregister(); } );
27 return frame.contentWindow.navigator.serviceWorker.getRegistration(
28 scope_for_iframe);
nhiroki 2016/04/25 04:56:35 +2 space indents
shimazu 2016/04/26 02:33:29 I think in this case 2-space indent is correct. [1
29 })
30 .then(function(r) {
31 frame.remove();
32 return promise_rejects(t, 'InvalidStateError', r.unregister());
33 });
34 }, 'Unregistration on a detached iframe should fail and throw ' +
35 'InvalidStateError exception');
36 </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