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

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

Issue 787893002: Actually hook up ServiceWorkerRegistration.showNotification() (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-forward-service-worker.js
diff --git a/LayoutTests/http/tests/notifications/resources/click-forward-service-worker.js b/LayoutTests/http/tests/notifications/resources/click-forward-service-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..0c9a7a778199ce8a9cc7b69f91a733dc3d77745f
--- /dev/null
+++ b/LayoutTests/http/tests/notifications/resources/click-forward-service-worker.js
@@ -0,0 +1,11 @@
+// Sends a message to all clients when the notificationclick event gets received.
+var messagePort = null;
+
+addEventListener('message', function(event) {
+ messagePort = event.data;
+ messagePort.postMessage('ready');
+});
+
+addEventListener('notificationclick', function(event) {
+ messagePort.postMessage('Clicked on Notification: ' + event.notification.title);
+});

Powered by Google App Engine
This is Rietveld 408576698