OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <title>ServiceWorkerGlobalScope: ExtendableMessageEvent</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 // This test should be in chromium/ because the spec does not define behavior in | |
9 // the case where postMessage() is called from a detached client. | |
falken
2017/03/21 14:42:56
I'm wondering why this file can be deleted given t
mike3
2017/03/21 17:15:29
It most certainly can *not* be deleted. This was m
| |
10 promise_test(function(t) { | |
11 var script = 'resources/empty-worker.js'; | |
12 var scope = 'resources/scope/extendable-message-event-from-detached'; | |
13 | |
14 return service_worker_unregister_and_register(t, script, scope) | |
15 .then(function(registration) { | |
16 add_completion_callback(function() { registration.unregister(); }); | |
17 return wait_for_state(t, registration.installing, 'activated'); | |
18 }) | |
19 .then(function() { return with_iframe(scope); }) | |
20 .then(function(frame) { | |
21 var worker = frame.contentWindow.navigator.serviceWorker.controller; | |
22 frame.remove(); | |
23 assert_throws( | |
24 { name: 'InvalidStateError' }, | |
25 function() { worker.postMessage(''); }, | |
26 'postMessage on a detached client should throw an exception.'); | |
27 }); | |
28 }, 'Post an extendable message from a detached client'); | |
29 | |
30 </script> | |
OLD | NEW |