Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 importScripts('worker-testharness.js'); | |
| 2 | |
| 3 promise_test(function() { | |
| 4 return self.skipWaiting() | |
| 5 .then(function(result) { | |
| 6 assert_equals(result, undefined, | |
| 7 'Promise should be resolved with undefined'); | |
| 8 }) | |
| 9 .then(function() { | |
| 10 var num = 8; | |
| 11 var promises = []; | |
| 12 for (var i = 0; i < num; ++i) | |
| 13 promises.push(skipWaiting()); | |
| 14 return Promise.all(promises) | |
| 15 .then(function(results) { | |
| 16 assert_equals(results.length, num, | |
| 17 'All promises should be resolved'); | |
|
falken
2014/12/01 02:28:48
Remove this assert. It's just testing the generic
xiang
2014/12/01 07:13:44
Done.
| |
| 18 results.forEach(function(r) { | |
| 19 assert_equals(r, undefined, | |
| 20 'Promises should be resolved with undefined'); | |
| 21 }); | |
| 22 }); | |
| 23 }); | |
| 24 }, 'skipWaiting'); | |
| OLD | NEW |