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

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

Issue 835673006: Use caller's document url to resolve scriptURL/patternURL in registerServiceWorker/getRegistration (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address comments in registration-iframe.html Created 5 years, 9 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 | LayoutTests/http/tests/serviceworker/controller-on-reload.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = base_path() + '../resources/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 '../resources/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
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/controller-on-reload.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698