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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/skip-waiting-worker.js

Issue 765323002: ServiceWorker: Add support for .skipWaiting and controllerchange event(3/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review update Created 6 years 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 side-by-side diff with in-line comments
Download patch
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');

Powered by Google App Engine
This is Rietveld 408576698