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

Unified Diff: chrome/test/data/notifications/android_test.html

Issue 2418153002: Hooking up Android N inline notification replies end-to-end (Closed)
Patch Set: Hooking up Android N inline notification replies end-to-end Created 4 years, 2 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: 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>

Powered by Google App Engine
This is Rietveld 408576698