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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/activate-event-after-install-state-change.https.html

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Rebase Created 4 years, 2 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>Service Worker: registration events</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.sub.js"></script>
6 <script>
7 promise_test(function(t) {
8 var script = 'resources/empty-worker.js';
9 var scope = 'resources/blank.html';
10 var registration;
11
12 return service_worker_unregister_and_register(t, script, scope)
13 .then(function(registration) {
14 var sw = registration.installing;
15
16 return new Promise(t.step_func(function(resolve) {
17 sw.onstatechange = t.step_func(function() {
18 if (sw.state === 'installed') {
19 assert_equals(registration.active, null,
20 'installed event should be fired before activating s ervice worker');
21 resolve();
22 }
23 });
24 }));
25 })
26 .then(function() {
27 return service_worker_unregister_and_done(t, scope);
28 })
29 .catch(unreached_rejection(t));
30 }, 'installed event should be fired before activating service worker');
31
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698