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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/sw-test-helpers.js

Issue 2877543003: [ServiceWorker] Allow waitUntil to be called multiple times asynchronously (Closed)
Patch Set: Address comments from falken@ Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/sw-test-helpers.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/sw-test-helpers.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/sw-test-helpers.js
index 3f81a544f3f02181e3d460f994b63af897902da1..974416ef6011b52bb0ea1d42a82f1694ff2ba290 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/sw-test-helpers.js
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium/resources/sw-test-helpers.js
@@ -61,6 +61,9 @@ self.synthesizeNotificationClick = function() {
var handler = function(e) {
resolve(e);
+ // To allow waitUntil to be called inside execution of the microtask
+ // enqueued by above resolve function.
+ e.waitUntil(Promise.resolve());
e.notification.close();
self.removeEventListener('notificationclick', handler);
};

Powered by Google App Engine
This is Rietveld 408576698