Index: third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js |
index 09b7724613d25acac74c9fdeed73b1c9be1ac87e..10e86d357cb69a811d90732e07f09b1b51f9d4b8 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js |
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js |
@@ -4,7 +4,13 @@ function match_query(query_string) { |
function receive_event(event_name) { |
return new Promise(function(resolve) { |
- self.addEventListener(event_name, resolve, false); |
+ 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()); |
+ }; |
+ self.addEventListener(event_name, handler, false); |
}); |
} |