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

Side by Side Diff: content/test/notifications/service_worker.js

Issue 1050623003: Move the Notification browser tests down to //content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-db-Integrate
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Service Worker to be used with the platform_notification_service.html page. 5 // Service Worker to be used with the test.html page.
6 var messagePort = null; 6 var messagePort = null;
7 7
8 addEventListener('message', function (event) { 8 addEventListener('message', function (event) {
9 messagePort = event.data; 9 messagePort = event.data;
10 messagePort.postMessage('ready'); 10 messagePort.postMessage('ready');
11 }); 11 });
12 12
13 // The notificationclick event will be invoked when a persistent notification 13 // The notificationclick event will be invoked when a persistent notification
14 // has been clicked on. When this happens, the title determines whether this 14 // has been clicked on. When this happens, the title determines whether this
15 // Service Worker has to act upon this. 15 // Service Worker has to act upon this.
16 addEventListener('notificationclick', function (event) { 16 addEventListener('notificationclick', function (event) {
17 if (event.notification.title == 'action_close') 17 if (event.notification.title == 'action_close')
18 event.notification.close(); 18 event.notification.close();
19 19
20 messagePort.postMessage(event.notification.title); 20 messagePort.postMessage(event.notification.title);
21 }); 21 });
OLDNEW
« no previous file with comments | « content/test/notifications/notification_test_utils.js ('k') | content/test/notifications/test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698