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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html

Issue 1644573002: Notification actions may have an icon url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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: third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html b/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html
index 1734452892cd451ff2cd0da163977106f437f4a3..e20895699d5a6adc9b724827003343a4505f1960 100644
--- a/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html
+++ b/third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html
@@ -52,12 +52,15 @@
// Deliberately add more actions than are supported.
for (var i = 0; i < 2 * Notification.maxActions; i++) {
options.actions.push({
- action: "a" + i,
- title: "Action " + i
+ action: 'a' + i,
+ title: 'Action ' + i,
+ icon: 'https://example/action_icon_' + i + '.png'
});
}
- testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
+ if (window.testRunner) {
+ testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
+ }
getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) {
// (1) Tell the Service Worker to display a Web Notification.
workerInfo.port.postMessage({
@@ -80,7 +83,9 @@
// notification's display promise has been resolved.
if (event.data.command == 'show') {
assert_true(event.data.success, 'The notification must have been displayed.');
- testRunner.simulateWebNotificationClick(scope, -1 /* action_index */);
+ if (window.testRunner) {
+ testRunner.simulateWebNotificationClick(scope, -1 /* action_index */);
+ }
return;
}
@@ -96,11 +101,11 @@
assert_equals(notifications.length, 1);
assert_object_is_superset(notifications[0], options, 'The Notification object properties must be the same in getNotifications.');
- notifications[0].actions.foo = "bar";
- notifications[0].actions.push({ title: "Foo" });
+ notifications[0].actions.foo = 'bar';
+ notifications[0].actions.push({ title: 'Foo' });
if (notifications[0].actions.length) {
- notifications[0].actions[0].title = "Changed";
- notifications[0].actions[0].foo = "bar";
+ notifications[0].actions[0].title = 'Changed';
+ notifications[0].actions[0].foo = 'bar';
}
assert_object_equals(notifications[0].actions, options.actions, 'The actions field should be immutable.');
« no previous file with comments | « content/public/common/platform_notification_data.h ('k') | third_party/WebKit/Source/modules/notifications/Notification.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698