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>
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',
21 frame
.contentWindow
.internals
.forceReload(true);
24 .then(t
.step_func(function() {
25 service_worker_unregister_and_done(t
, scope
);
27 .catch(unreached_rejection(t
));
28 }, 'Registering script from force-refreshed frame');