OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>ServiceWorkerGlobalScope: registration</title> | |
3 <script src="../../resources/testharness.js"></script> | |
4 <script src="../../resources/testharnessreport.js"></script> | |
5 <script src="../resources/test-helpers.js"></script> | |
6 <script> | |
7 | |
8 promise_test(function(t) { | |
9 var script = "resources/registration-attribute-worker.js"; | |
10 var scope = "resources/scope/registration-attribute"; | |
falken
2015/01/27 04:08:15
nit: single-quotes for javascript strings
nhiroki
2015/01/27 07:51:26
Done.
| |
11 | |
12 return navigator.serviceWorker.register(script, {scope: scope}) | |
falken
2015/01/27 04:08:15
nit: we typically do unregister_and_register() in
nhiroki
2015/01/27 07:51:26
Done.
| |
13 .then(function(registration) { | |
14 return wait_for_state(t, registration.installing, 'activated'); | |
15 }) | |
16 .then(function() { return with_iframe(scope); }) | |
17 .then(function(frame) { | |
18 assert_equals( | |
19 frame.contentDocument.body.textContent, | |
20 'Hello, world!', | |
21 'Service Worker should respond to fetch'); | |
22 frame.remove(); | |
23 return service_worker_unregister_and_done(t, scope); | |
24 }); | |
25 }, 'Verify registration attribute on ServiceWorkerGlobalScope'); | |
26 | |
27 </script> | |
OLD | NEW |