OLD | NEW |
| (Empty) |
1 importScripts('/resources/testharness.js'); | |
2 | |
3 test(function() { | |
4 assert_own_property(self, 'PushEvent'); | |
5 | |
6 var event = new PushEvent('PushEvent'); | |
7 assert_idl_attribute(event, 'data'); | |
8 assert_equals(event.type, 'PushEvent'); | |
9 | |
10 // PushEvent should be extending ExtendableEvent. | |
11 assert_inherits(event, 'waitUntil'); | |
12 | |
13 }, 'PushEvent should be exposed and have the expected interface.'); | |
14 | |
15 test(function() { | |
16 assert_own_property(self, 'PushManager', 'PushManager needs to be exposed as
a global.'); | |
17 assert_idl_attribute(registration, 'pushManager', 'PushManager needs to be e
xposed on the registration.'); | |
18 | |
19 assert_own_property(PushManager, 'supportedContentEncodings'); | |
20 | |
21 assert_inherits(registration.pushManager, 'subscribe'); | |
22 assert_inherits(registration.pushManager, 'getSubscription'); | |
23 assert_inherits(registration.pushManager, 'permissionState'); | |
24 | |
25 }, 'PushManager should be exposed and have the expected interface.'); | |
26 | |
27 test(function() { | |
28 assert_own_property(self, 'PushMessageData', 'PushMessageData needs to be ex
posed as a global.'); | |
29 | |
30 var pushMessageData = new PushEvent('PushEvent', { data: 'SomeData' }).data; | |
31 assert_inherits(pushMessageData, 'arrayBuffer'); | |
32 assert_inherits(pushMessageData, 'blob'); | |
33 assert_inherits(pushMessageData, 'json'); | |
34 assert_inherits(pushMessageData, 'text'); | |
35 | |
36 }, 'PushMessageData should be exposed and have the expected interface.'); | |
37 | |
38 test(function() { | |
39 assert_own_property(self, 'PushSubscription', 'PushSubscription needs to be
exposed as a global.'); | |
40 | |
41 assert_own_property(PushSubscription.prototype, 'endpoint'); | |
42 | |
43 assert_own_property(PushSubscription.prototype, 'getKey'); | |
44 assert_own_property(PushSubscription.prototype, 'unsubscribe'); | |
45 | |
46 }, 'PushSubscription should be exposed and have the expected interface.'); | |
OLD | NEW |