Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / chromium / force-refresh-registration.html
bloba1bc0648f2ecb7b06aa7d3588e9e20b7342c6452
1 <!DOCTYPE html>
2 <title>Service Worker: force-refresh registration test</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="../resources/test-helpers.js"></script>
6 <body>
7 <script>
9 async_test(function(t) {
10 var scope = base_path() + '../resources/force-refresh-register';
11 with_iframe('../resources/blank.html')
12 .then(t.step_func(function(frame) {
13 var p = new Promise(function(resolve) {
14 // Override onload handler assigned by with_iframe.
15 frame.onload = t.step_func(function() {
16 resolve(frame.contentWindow.navigator.serviceWorker.register(
17 '../resources/empty-worker.js',
18 {scope: scope}));
19 });
20 });
21 frame.contentWindow.internals.forceReload(true);
22 return p;
23 }))
24 .then(t.step_func(function() {
25 service_worker_unregister_and_done(t, scope);
26 }))
27 .catch(unreached_rejection(t));
28 }, 'Registering script from force-refreshed frame');
30 </script>