Chromium Code Reviews| 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 d9fb5a297c918da802fdda4a481b347cbe25e9b5..3bbb2217bbc1bf7bdaacff04ca894ed30050229b 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,13 @@ function simulateNotificationClick(title, actionIndex, port) |
| }); |
| }); |
| } |
| + |
| +function listenOnce(target, type) |
|
Peter Beverloo
2016/04/21 17:27:00
++docs
Michael van Ouwerkerk
2016/04/22 13:24:09
Done.
|
| +{ |
| + return new Promise((resolve, reject) => { |
| + target.addEventListener(type, function listener(event) { |
| + target.removeEventListener(type, listener); |
| + resolve(event); |
| + }); |
| + }); |
| +} |