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

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: add new test 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..ab4f2f7954fbd4cb202b463b76bcf735947e56a2
--- /dev/null
+++ b/LayoutTests/http/tests/serviceworker/resources/skip-waiting-worker.js
@@ -0,0 +1,21 @@
+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 promises = [];
+ for (var i = 0; i < 8; ++i)
+ promises.push(skipWaiting());
+ return Promise.all(promises);
+ })
+ .then(function(results) {
+ results.forEach(function(r) {
+ assert_equals(r, undefined,
+ 'Promises should be resolved with undefined');
+ });
+ });
+ }, 'skipWaiting');

Powered by Google App Engine
This is Rietveld 408576698