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