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

Unified Diff: LayoutTests/http/tests/notifications/resources/click-close-service-worker.js

Issue 789643003: The Service Worker notificationclick event should carry a notification. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add missing file Created 6 years 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: LayoutTests/http/tests/notifications/resources/click-close-service-worker.js
diff --git a/LayoutTests/http/tests/notifications/resources/click-close-service-worker.js b/LayoutTests/http/tests/notifications/resources/click-close-service-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..988e7bd54a0f7b4f4a0d5c58de6d19de79106b26
--- /dev/null
+++ b/LayoutTests/http/tests/notifications/resources/click-close-service-worker.js
@@ -0,0 +1,12 @@
+// Sends a message to all clients when the notificationclick event gets received.
Michael van Ouwerkerk 2014/12/09 19:49:20 Does it? Afaict it just messages to its single mes
Peter Beverloo 2014/12/10 14:11:09 Done.
+var messagePort = null;
+
+addEventListener('message', function(event) {
+ messagePort = event.data;
+ messagePort.postMessage('ready');
+});
+
+addEventListener('notificationclick', function(event) {
+ event.notification.close();
+ messagePort.postMessage('Clicked on Notification: ' + event.notification.title);
+});

Powered by Google App Engine
This is Rietveld 408576698