| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
| 3 <title>NavigationPreloadManager.getState</title> | 3 <title>NavigationPreloadManager.getState</title> |
| 4 <script src="../../resources/testharness.js"></script> | 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="../../resources/testharnessreport.js"></script> | 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <script src="../resources/test-helpers.js"></script> | 6 <script src="../resources/test-helpers.sub.js"></script> |
| 7 <script src="resources/helpers.js"></script> | 7 <script src="resources/helpers.js"></script> |
| 8 <body> | 8 <body> |
| 9 <script> | 9 <script> |
| 10 function post_and_wait_for_reply(worker, message) { | 10 function post_and_wait_for_reply(worker, message) { |
| 11 return new Promise(resolve => { | 11 return new Promise(resolve => { |
| 12 navigator.serviceWorker.onmessage = e => { resolve(e.data); }; | 12 navigator.serviceWorker.onmessage = e => { resolve(e.data); }; |
| 13 worker.postMessage(message); | 13 worker.postMessage(message); |
| 14 }); | 14 }); |
| 15 } | 15 } |
| 16 | 16 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 .then(() => np.getState()) | 208 .then(() => np.getState()) |
| 209 .then(state => { | 209 .then(state => { |
| 210 expect_navigation_preload_state(state, false, 'true', | 210 expect_navigation_preload_state(state, false, 'true', |
| 211 'state before activation'); | 211 'state before activation'); |
| 212 return post_and_wait_for_reply(registration.installing, 'ping'); | 212 return post_and_wait_for_reply(registration.installing, 'ping'); |
| 213 }) | 213 }) |
| 214 .then(result => assert_equals(result, 'PASS')); | 214 .then(result => assert_equals(result, 'PASS')); |
| 215 }, 'no active worker'); | 215 }, 'no active worker'); |
| 216 </script> | 216 </script> |
| 217 </body> | 217 </body> |
| OLD | NEW |