Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / notifications / resources / serviceworker-notification-event.js
bloba46d320edc1523a9793046ba68e3962190968722
1 importScripts('../../serviceworker/resources/worker-testharness.js');
2 importScripts('/resources/testharness-helpers.js');
4 test(function() {
5     assert_true('NotificationEvent' in self);
7     var event = new NotificationEvent('NotificationEvent');
8     assert_equals(event.type, 'NotificationEvent');
9     assert_will_be_idl_attribute(event, 'notification');
10     assert_will_be_idl_attribute(event, 'action');
11     assert_equals(event.cancelable, false);
12     assert_equals(event.bubbles, false);
13     assert_equals(event.notification, null);
14     assert_equals(event.action, "");
15     assert_inherits(event, 'waitUntil');
17     var eventWithInit = new NotificationEvent('NotificationEvent',
18                                               { cancelable: true,
19                                                 bubbles: true
20                                               });
21     assert_equals(eventWithInit.cancelable, true);
22     assert_equals(eventWithInit.bubbles, true);
24 }, 'NotificationEvent is exposed, and has the expected interface.');
26 test(function() {
27     assert_will_be_idl_attribute(self, 'onnotificationclick',
28                                  'The notificationclick event exists.');
30 }, 'The notificationclick event exists on the global scope.');