Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
|
falken
2015/06/17 15:10:55
Can you add a brief comment about why this test is
| |
| 2 <title>Service Worker: force-refresh ready test</title> | |
| 3 <script src="../../resources/testharness.js"></script> | |
| 4 <script src="../../resources/testharness-helpers.js"></script> | |
| 5 <script src="../../resources/testharnessreport.js"></script> | |
| 6 <script src="../resources/test-helpers.js"></script> | |
| 7 <body> | |
| 8 <script> | |
| 9 | |
| 10 promise_test(function(t) { | |
| 11 var scope = '../resources/blank.html'; | |
| 12 var script_url = '../resources/empty-worker.js'; | |
| 13 return service_worker_unregister_and_register(t, script_url, scope) | |
| 14 .then(function(registration) { | |
| 15 return wait_for_state(t, registration.installing, 'activated'); | |
| 16 }) | |
| 17 .then(function() { | |
| 18 return with_iframe(scope); | |
| 19 }) | |
| 20 .then(function(frame) { | |
| 21 return new Promise(function(resolve) { | |
| 22 frame.onload = t.step_func(function() { | |
| 23 frame.contentWindow.navigator.serviceWorker.ready | |
| 24 .then(function() { | |
| 25 resolve(); | |
| 26 }); | |
| 27 }); | |
| 28 frame.contentWindow.internals.forceReload(true); | |
| 29 }); | |
| 30 }) | |
| 31 .then(function() { | |
| 32 return service_worker_unregister_and_done(t, scope); | |
| 33 }); | |
| 34 }, 'Test ready promise for force-refreshed frame'); | |
| 35 | |
| 36 </script> | |
| OLD | NEW |