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

Side by Side Diff: LayoutTests/http/tests/notifications/resources/serviceworker-notification-event.js

Issue 780963004: Use event init dictionaries in modules/{notifications,push_messaging,serviceworkers} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/push_messaging/resources/pushevent-extendable-event.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 importScripts('../../serviceworker/resources/worker-testharness.js'); 1 importScripts('../../serviceworker/resources/worker-testharness.js');
2 importScripts('/resources/testharness-helpers.js'); 2 importScripts('/resources/testharness-helpers.js');
3 3
4 test(function() { 4 test(function() {
5 assert_true('NotificationEvent' in self); 5 assert_true('NotificationEvent' in self);
6 6
7 var event = new NotificationEvent('NotificationEvent'); 7 var event = new NotificationEvent('NotificationEvent');
8 assert_equals(event.type, 'NotificationEvent'); 8 assert_equals(event.type, 'NotificationEvent');
9 assert_own_property(event, 'notification'); 9 assert_own_property(event, 'notification');
10 assert_equals(event.cancelable, false);
11 assert_equals(event.bubbles, false);
12 assert_equals(event.notification, null);
10 assert_inherits(event, 'waitUntil'); 13 assert_inherits(event, 'waitUntil');
11 14
15 var notification = new Notification('foo');
16 var eventWithInit = new NotificationEvent('NotificationEvent',
17 { cancelable: true,
18 bubbles: true,
19 notification: notification,
20 });
21 assert_equals(eventWithInit.cancelable, true);
22 assert_equals(eventWithInit.bubbles, true);
23 assert_equals(eventWithInit.notification, notification);
24
12 }, 'NotificationEvent is exposed, and has the expected interface.'); 25 }, 'NotificationEvent is exposed, and has the expected interface.');
13 26
14 test(function() { 27 test(function() {
15 assert_own_property(self, 'onnotificationclick', 'The notificationclick even t exists.'); 28 assert_own_property(self, 'onnotificationclick', 'The notificationclick even t exists.');
16 assert_own_property(self, 'onnotificationerror', 'The notificationerror even t exists.'); 29 assert_own_property(self, 'onnotificationerror', 'The notificationerror even t exists.');
17 30
18 }, 'The notificationclick and notificationerror events exist on the global scope .'); 31 }, 'The notificationclick and notificationerror events exist on the global scope .');
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/push_messaging/resources/pushevent-extendable-event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698