2 <!-- This test should not be upstreamed due to shift-reload behavior
3 is not defined by spec. -->
4 <title>Service Worker: force-refresh ready test
</title>
5 <script src=
"../../resources/testharness.js"></script>
6 <script src=
"../../resources/testharness-helpers.js"></script>
7 <script src=
"../../resources/testharnessreport.js"></script>
8 <script src=
"../resources/test-helpers.js"></script>
12 promise_test(function(t
) {
13 var scope
= '../resources/blank.html';
14 var script_url
= '../resources/empty-worker.js';
16 return service_worker_unregister_and_register(t
, script_url
, scope
)
17 .then(function(registration
) {
18 return wait_for_state(t
, registration
.installing
, 'activated');
21 return with_iframe(scope
);
25 return new Promise(function(resolve
) {
26 frame
.onload
= t
.step_func(function() {
27 frame
.contentWindow
.navigator
.serviceWorker
.ready
32 frame
.contentWindow
.internals
.forceReload(true);
37 return service_worker_unregister_and_done(t
, scope
);
39 }, 'Test ready promise for force-refreshed frame');