Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/extendable-message-event.html

Issue 2751113005: Upstream service worker message event tests to WPT (Closed)
Patch Set: Incorporate review feedback Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698