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

Side by Side Diff: LayoutTests/http/tests/serviceworker/chromium/force-refresh-registration.html

Issue 674133004: [ServiceWorker] Introduce the directory restriction of ServiceWorker scope [1/3 blink] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/scope-default.html Created 6 years, 1 month 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: force-refresh registration test</title> 2 <title>Service Worker: force-refresh registration test</title>
3 <script src="../../resources/testharness.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="../resources/test-helpers.js"></script> 5 <script src="../resources/test-helpers.js"></script>
6 <body> 6 <body>
7 <script> 7 <script>
8 8
9 async_test(function(t) { 9 async_test(function(t) {
10 var scope = '/force-refresh-register'; 10 var scope = base_path() + '../resources/force-refresh-register';
11 with_iframe('../resources/blank.html') 11 with_iframe('../resources/blank.html')
12 .then(t.step_func(function(frame) { 12 .then(t.step_func(function(frame) {
13 var p = new Promise(function(resolve) { 13 var p = new Promise(function(resolve) {
14 // Override onload handler assigned by with_iframe. 14 // Override onload handler assigned by with_iframe.
15 frame.onload = t.step_func(function() { 15 frame.onload = t.step_func(function() {
16 resolve(frame.contentWindow.navigator.serviceWorker.register( 16 resolve(frame.contentWindow.navigator.serviceWorker.register(
17 'empty-worker.js', 17 'empty-worker.js',
18 {scope: scope})); 18 {scope: scope}));
19 }); 19 });
20 }); 20 });
21 frame.contentWindow.internals.forceReload(true); 21 frame.contentWindow.internals.forceReload(true);
22 return p; 22 return p;
23 })) 23 }))
24 .then(t.step_func(function() { 24 .then(t.step_func(function() {
25 service_worker_unregister_and_done(t, scope); 25 service_worker_unregister_and_done(t, scope);
26 })) 26 }))
27 .catch(unreached_rejection(t)); 27 .catch(unreached_rejection(t));
28 }, 'Registering script from force-refreshed frame'); 28 }, 'Registering script from force-refreshed frame');
29 29
30 </script> 30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698