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

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

Issue 965573002: Implement support for silent notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 5 years, 9 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/platform_notification_service.html
diff --git a/chrome/test/data/notifications/platform_notification_service.html b/chrome/test/data/notifications/platform_notification_service.html
index 75c15ce2934fd9bee6661e799d10c319f17d3de9..3c6ea37e2ad2376eaa6bcf2984f773bde2b6147d 100644
--- a/chrome/test/data/notifications/platform_notification_service.html
+++ b/chrome/test/data/notifications/platform_notification_service.html
@@ -23,14 +23,14 @@
// Renews the registered Service Worker registration for this page, then
// displays a notification on the activated ServiceWorkerRegistration.
- function DisplayPersistentNotification(title) {
+ function DisplayPersistentNotification(title, options) {
+ options = options || { body: 'Hello, world!',
+ icon: 'icon.png' };
+
GetActivatedServiceWorker('platform_notification_service.js',
location.pathname)
.then(function (registration) {
- return registration.showNotification(title, {
- body: 'Hello, world!',
- icon: 'icon.png'
- });
+ return registration.showNotification(title, options);
}).then(function () {
messagePort.addEventListener('message', function (event) {
if (expectingMessage)
@@ -45,6 +45,19 @@
});
}
+ // Displays a persistent notification having every field in its options
+ // bag filled out with non-default values.
+ function DisplayPersistentAllOptionsNotification() {
+ DisplayPersistentNotification('Title', {
+ dir: 'rtl',
+ lang: 'nl-NL',
+ body: 'Contents',
+ tag: 'replace-id',
+ icon: 'icon.png',
+ silent: true
+ });
+ }
+
// Returns the latest received message from the worker. If no message has
// been received, nothing will be done. For successfully registered
// Service Workers this is OK, however, since the "message" event handler

Powered by Google App Engine
This is Rietveld 408576698