| Index: LayoutTests/http/tests/serviceworker/chromium/force-refresh-ready.html
|
| diff --git a/LayoutTests/http/tests/serviceworker/chromium/force-refresh-ready.html b/LayoutTests/http/tests/serviceworker/chromium/force-refresh-ready.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f825b9b590db35872f6aea8e3bcd8cf7376a25d9
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/serviceworker/chromium/force-refresh-ready.html
|
| @@ -0,0 +1,42 @@
|
| +<!DOCTYPE html>
|
| +<!-- This test should not be upstreamed due to shift-reload behavior
|
| +is not defined by spec. -->
|
| +<title>Service Worker: force-refresh ready test</title>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharness-helpers.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../resources/test-helpers.js"></script>
|
| +<body>
|
| +<script>
|
| +
|
| +promise_test(function(t) {
|
| + var scope = '../resources/blank.html';
|
| + var script_url = '../resources/empty-worker.js';
|
| + var frame;
|
| + return service_worker_unregister_and_register(t, script_url, scope)
|
| + .then(function(registration) {
|
| + return wait_for_state(t, registration.installing, 'activated');
|
| + })
|
| + .then(function() {
|
| + return with_iframe(scope);
|
| + })
|
| + .then(function(f) {
|
| + frame = f;
|
| + return new Promise(function(resolve) {
|
| + frame.onload = t.step_func(function() {
|
| + frame.contentWindow.navigator.serviceWorker.ready
|
| + .then(function() {
|
| + resolve();
|
| + });
|
| + });
|
| + frame.contentWindow.internals.forceReload(true);
|
| + });
|
| + })
|
| + .then(function() {
|
| + frame.remove();
|
| + return service_worker_unregister_and_done(t, scope);
|
| + });
|
| + }, 'Test ready promise for force-refreshed frame');
|
| +
|
| +</script>
|
| +</body>
|
|
|