Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
|
falken
2017/03/17 15:37:48
For some reason Rietveld annotates this file diff
mike3
2017/03/17 16:31:40
As far as I can tell, yes, this file is deleted. (
| |
| 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. | |
| 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 |