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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/notifications/resources/test-helpers.js

Issue 1909043003: Tests that notification resource requests are handled by onfetch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NotificationTestsUsePromises
Patch Set: Delete unused variable. Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/notifications/serviceworkerregistration-document-fetch-resources.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/notifications/resources/test-helpers.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/notifications/resources/test-helpers.js b/third_party/WebKit/LayoutTests/http/tests/notifications/resources/test-helpers.js
index 608f37f42f7520efd4bea4809ae6123f24d49634..b94677f26dfc8a8742da9309fde175e7a9cf0bf4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/notifications/resources/test-helpers.js
+++ b/third_party/WebKit/LayoutTests/http/tests/notifications/resources/test-helpers.js
@@ -101,3 +101,15 @@ function simulateNotificationClick(title, actionIndex, port)
});
});
}
+
+// Sets up a listener for events of |type| on |target|. The listener is removed the first time the
+// event fires. Returns a promise that resolves with the fired event.
+function listenOnce(target, type)
+{
+ return new Promise((resolve, reject) => {
+ target.addEventListener(type, function listener(event) {
+ target.removeEventListener(type, listener);
+ resolve(event);
+ });
+ });
+}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/notifications/serviceworkerregistration-document-fetch-resources.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698