Chromium Code Reviews| Index: chrome/test/data/notifications/android_test.html |
| diff --git a/chrome/test/data/notifications/android_test.html b/chrome/test/data/notifications/android_test.html |
| index 7d6dfce5eba56a0858556cad37b9f2a6e9bdc34b..0367bb41c3ceb3cc51348a30c3dc6ad8437f34c9 100644 |
| --- a/chrome/test/data/notifications/android_test.html |
| +++ b/chrome/test/data/notifications/android_test.html |
| @@ -11,7 +11,14 @@ |
| <script> |
| function showNotification(title, options) { |
| GetActivatedServiceWorker('android_test_worker.js', location.pathname) |
| - .then(registration => registration.showNotification(title, options)) |
| + .then(registration => { |
| + messagePort.addEventListener('message', function(event) { |
| + if (event.data.startsWith('reply: ')) { |
| + sendToTest(event.data); |
|
Peter Beverloo
2016/10/17 14:11:40
nit: consider naming the function and unregisterin
awdf
2016/10/17 14:51:24
Done.
|
| + } |
| + }); |
| + return registration.showNotification(title, options); |
| + }) |
| .catch(sendToTest); |
| } |
| @@ -30,4 +37,4 @@ |
| } |
| </script> |
| </body> |
| -</html> |
| +</html> |