OLD | NEW |
1 importScripts('/resources/testharness.js'); | 1 importScripts('/resources/testharness.js'); |
2 importScripts('/resources/testharness-helpers.js'); | 2 importScripts('/resources/testharness-helpers.js'); |
3 | 3 |
4 test(function() { | 4 test(function() { |
5 assert_own_property(self, 'SyncManager', 'SyncManager needs to be exposed as
a global.'); | 5 assert_own_property(self, 'SyncManager', 'SyncManager needs to be exposed as
a global.'); |
6 assert_will_be_idl_attribute(registration, 'syncManager', 'syncManager needs
to be exposed on the registration.'); | 6 assert_will_be_idl_attribute(registration, 'sync', 'One-shot SyncManager nee
ds to be exposed on the registration.'); |
7 | 7 |
8 assert_inherits(registration.syncManager, 'register'); | 8 assert_inherits(registration.sync, 'register'); |
9 assert_inherits(registration.syncManager, 'getRegistration'); | 9 assert_inherits(registration.sync, 'getRegistration'); |
10 assert_inherits(registration.syncManager, 'getRegistrations'); | 10 assert_inherits(registration.sync, 'getRegistrations'); |
11 // FIXME: Re-enable this once permissions are wired up | 11 assert_inherits(registration.sync, 'permissionState'); |
12 //assert_inherits(registration.syncManager, 'hasPermission'); | |
13 | 12 |
14 }, 'SyncManager should be exposed and have the expected interface.'); | 13 }, 'SyncManager should be exposed and have the expected interface.'); |
15 | 14 |
16 test(function() { | 15 test(function() { |
17 assert_own_property(self, 'SyncRegistration', 'PushRegistration needs to be
exposed as a global.'); | 16 assert_own_property(self, 'PeriodicSyncManager', 'PeriodicSyncManager needs
to be exposed as a global.'); |
| 17 assert_will_be_idl_attribute(registration, 'periodicSync', 'Periodic SyncMan
ager needs to be exposed on the registration.'); |
| 18 |
| 19 assert_inherits(registration.periodicSync, 'register'); |
| 20 assert_inherits(registration.periodicSync, 'getRegistration'); |
| 21 assert_inherits(registration.periodicSync, 'getRegistrations'); |
| 22 assert_inherits(registration.periodicSync, 'permissionState'); |
| 23 |
| 24 }, 'PeriodicSyncManager should be exposed and have the expected interface.'); |
| 25 |
| 26 test(function() { |
| 27 assert_own_property(self, 'SyncRegistration', 'SyncRegistration needs to be
exposed as a global.'); |
18 | 28 |
19 // FIXME: Assert existence of the attributes when they are properly | 29 // FIXME: Assert existence of the attributes when they are properly |
20 // exposed in the prototype chain. https://crbug.com/43394 | 30 // exposed in the prototype chain. https://crbug.com/43394 |
21 | 31 |
22 assert_own_property(SyncRegistration.prototype, 'unregister'); | 32 assert_own_property(SyncRegistration.prototype, 'unregister'); |
23 | 33 |
24 }, 'SyncRegistration should be exposed and have the expected interface.'); | 34 }, 'SyncRegistration should be exposed and have the expected interface.'); |
25 | 35 |
26 test(function() { | 36 test(function() { |
| 37 assert_own_property(self, 'PeriodicSyncRegistration', 'PeriodicSyncRegistrat
ion needs to be exposed as a global.'); |
| 38 |
| 39 // FIXME: Assert existence of the attributes when they are properly |
| 40 // exposed in the prototype chain. https://crbug.com/43394 |
| 41 |
| 42 assert_own_property(PeriodicSyncRegistration.prototype, 'unregister'); |
| 43 |
| 44 }, 'PeriodicSyncRegistration should be exposed and have the expected interface.'
); |
| 45 |
| 46 test(function() { |
27 assert_own_property(self, 'SyncEvent'); | 47 assert_own_property(self, 'SyncEvent'); |
28 | 48 |
29 var event = new SyncEvent('SyncEvent', {id: 'SyncEvent'}); | |
30 assert_will_be_idl_attribute(event, 'registration'); | |
31 assert_equals(event.type, 'SyncEvent'); | |
32 | |
33 // SyncEvent should be extending ExtendableEvent. | 49 // SyncEvent should be extending ExtendableEvent. |
34 assert_inherits(event, 'waitUntil'); | 50 assert_inherits(SyncEvent.prototype, 'waitUntil'); |
35 | 51 |
36 }, 'SyncEvent should be exposed and have the expected interface.'); | 52 }, 'SyncEvent should be exposed and have the expected interface.'); |
37 | 53 |
| 54 test(function() { |
| 55 assert_own_property(self, 'PeriodicSyncEvent'); |
| 56 |
| 57 // PeriodicSyncEvent should be extending ExtendableEvent. |
| 58 assert_inherits(PeriodicSyncEvent.prototype, 'waitUntil'); |
| 59 |
| 60 }, 'PeriodicSyncEvent should be exposed and have the expected interface.'); |
| 61 |
OLD | NEW |