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

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

Issue 2789003002: Upstream service worker ext. event tests to WPT (Closed)
Patch Set: Created 3 years, 8 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 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <script src="resources/test-helpers.js"></script>
5 <script>
6 promise_test(function(t) {
7 var script = 'resources/extendable-event-async-waituntil.js';
8 var scope = 'resources/async-waituntil';
9 var worker;
10
11 return service_worker_unregister_and_register(t, script, scope)
12 .then(function(registration) {
13 worker = registration.installing;
14 return wait_for_state(t, worker, 'activated');
15 })
16 .then(function() {
17 var channel = new MessageChannel();
18 var saw_message = new Promise(function(resolve) {
19 channel.port1.onmessage = function(e) { resolve(e.data); }
20 });
21 worker.postMessage({port: channel.port2}, [channel.port2]);
22 return saw_message;
23 })
24 .then(function(message) {
25 assert_equals(message, 'PASS');
26 return service_worker_unregister_and_done(t, scope);
27 })
28 }, 'Calling waitUntil asynchronously throws an exception');
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698