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

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

Issue 2418153002: Hooking up Android N inline notification replies end-to-end (Closed)
Patch Set: Reformat getNotificationReply 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..073972dfd1f80537c9519257bd3fbd34f3e60528 100644
--- a/chrome/test/data/notifications/android_test.html
+++ b/chrome/test/data/notifications/android_test.html
@@ -11,7 +11,15 @@
<script>
function showNotification(title, options) {
GetActivatedServiceWorker('android_test_worker.js', location.pathname)
- .then(registration => registration.showNotification(title, options))
+ .then(registration => {
+ messagePort.addEventListener('message', function replyListener(event) {
+ if (event.data.startsWith('reply: ')) {
+ messagePort.removeEventListener('message', replyListener);
+ sendToTest(event.data);
+ }
+ });
+ return registration.showNotification(title, options);
+ })
.catch(sendToTest);
}
@@ -30,4 +38,4 @@
}
</script>
</body>
-</html>
+</html>

Powered by Google App Engine
This is Rietveld 408576698