OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> |
| 3 <title>Tests for importScripts: script resource map</title> |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <script src="resources/test-helpers.sub.js"></script> |
| 7 <body> |
| 8 <script> |
| 9 // This test registers a worker that imports a script multiple times. The |
| 10 // script should be stored on the first import and thereafter that stored |
| 11 // script should be loaded. The worker asserts that the stored script was |
| 12 // loaded; if the assert fails then registration fails. |
| 13 promise_test(t => { |
| 14 const scope = 'resources/import-scripts-resource-map'; |
| 15 return service_worker_unregister(t, scope) |
| 16 .then(() => { |
| 17 return navigator.serviceWorker.register( |
| 18 'resources/import-scripts-resource-map-worker.js', {scope: scope})
; |
| 19 }) |
| 20 .then(r => r.unregister()); |
| 21 }, 'import the same script URL multiple times'); |
| 22 </script> |
| 23 </body> |
OLD | NEW |