Chromium Code Reviews| Index: LayoutTests/http/tests/serviceworker/resources/skip-waiting-worker.js |
| diff --git a/LayoutTests/http/tests/serviceworker/resources/skip-waiting-worker.js b/LayoutTests/http/tests/serviceworker/resources/skip-waiting-worker.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e7d51ceaa89bdf1eab601a622e89f41249f34cee |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/serviceworker/resources/skip-waiting-worker.js |
| @@ -0,0 +1,22 @@ |
| +importScripts('worker-testharness.js'); |
| + |
| +promise_test(function() { |
| + return self.skipWaiting() |
| + .then(function(result) { |
| + assert_equals(result, undefined, |
| + 'Promise should be resolved with undefined'); |
| + }) |
| + .then(function() { |
| + var num = 8; |
| + var promises = []; |
| + for (var i = 0; i < num; ++i) |
| + promises.push(skipWaiting()); |
| + return Promise.all(promises) |
| + .then(function(results) { |
|
falken
2014/12/04 06:15:38
nit: you can save indentation by shifting this fun
xiang
2014/12/11 11:24:32
Done.
|
| + results.forEach(function(r) { |
| + assert_equals(r, undefined, |
| + 'Promises should be resolved with undefined'); |
| + }); |
| + }); |
| + }); |
| + }, 'skipWaiting'); |