Chromium Code Reviews| 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..a01401685dbe4d162beee3ba797f8846d73bda77 |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/serviceworker/chromium/force-refresh-ready.html |
| @@ -0,0 +1,36 @@ |
| +<!DOCTYPE html> |
|
falken
2015/06/17 15:10:55
Can you add a brief comment about why this test is
|
| +<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'; |
| + 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(frame) { |
| + 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() { |
| + return service_worker_unregister_and_done(t, scope); |
| + }); |
| +}, 'Test ready promise for force-refreshed frame'); |
| + |
| +</script> |