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

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: 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/notifications/service-worker-show-notification-click.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0904d2db9acee06cda52129b5571c380dba3e074
--- /dev/null
+++ b/LayoutTests/http/tests/notifications/resources/click-forward-service-worker.js
@@ -0,0 +1,12 @@
+// 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) {
+ // FIXME: Include the notification's title in the confirmation reply.
+ messagePort.postMessage('The notification has been clicked on.');
+});
« no previous file with comments | « no previous file | LayoutTests/http/tests/notifications/service-worker-show-notification-click.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698