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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/resources/skip-waiting-worker.js

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
1 importScripts('worker-testharness.js'); 1 importScripts('worker-testharness.js');
2 2
3 promise_test(function() { 3 promise_test(function() {
4 return self.skipWaiting() 4 return skipWaiting()
5 .then(function(result) { 5 .then(function(result) {
6 assert_equals(result, undefined, 6 assert_equals(result, undefined,
7 'Promise should be resolved with undefined'); 7 'Promise should be resolved with undefined');
8 }) 8 })
9 .then(function() { 9 .then(function() {
10 var promises = []; 10 var promises = [];
11 for (var i = 0; i < 8; ++i) 11 for (var i = 0; i < 8; ++i)
12 promises.push(self.skipWaiting()); 12 promises.push(self.skipWaiting());
13 return Promise.all(promises); 13 return Promise.all(promises);
14 }) 14 })
15 .then(function(results) { 15 .then(function(results) {
16 results.forEach(function(r) { 16 results.forEach(function(r) {
17 assert_equals(r, undefined, 17 assert_equals(r, undefined,
18 'Promises should be resolved with undefined'); 18 'Promises should be resolved with undefined');
19 }); 19 });
20 }); 20 });
21 }, 'skipWaiting'); 21 }, 'skipWaiting');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698