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

Side by Side Diff: LayoutTests/http/tests/background_sync/resources/interfaces-worker.js

Issue 1096503002: [Background Sync] Converting Blink code to the MVP API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make sure ids are 64 bit; fix formatting anomaly Created 5 years, 8 months 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
OLDNEW
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 // FIXME: Re-enable this once permissions are wired up
12 //assert_inherits(registration.syncManager, 'hasPermission'); 12 //assert_inherits(registration.syncManager, 'hasPermission');
13 13
14 }, 'SyncManager should be exposed and have the expected interface.'); 14 }, 'SyncManager should be exposed and have the expected interface.');
15 15
16 test(function() { 16 test(function() {
17 assert_own_property(self, 'SyncRegistration', 'PushRegistration needs to be exposed as a global.'); 17 assert_own_property(self, 'PeriodicSyncManager', 'PeriodicSyncManager needs to be exposed as a global.');
18 assert_will_be_idl_attribute(registration, 'periodicSync', 'Periodic SyncMan ager needs to be exposed on the registration.');
19
20 assert_inherits(registration.periodicSync, 'register');
21 assert_inherits(registration.periodicSync, 'getRegistration');
22 assert_inherits(registration.periodicSync, 'getRegistrations');
23 // FIXME: Re-enable this once permissions are wired up
24 //assert_inherits(registration.syncManager, 'hasPermission');
25
26 }, 'PeriodicSyncManager should be exposed and have the expected interface.');
27
28 test(function() {
29 assert_own_property(self, 'SyncRegistration', 'SyncRegistration needs to be exposed as a global.');
18 30
19 // FIXME: Assert existence of the attributes when they are properly 31 // FIXME: Assert existence of the attributes when they are properly
20 // exposed in the prototype chain. https://crbug.com/43394 32 // exposed in the prototype chain. https://crbug.com/43394
21 33
22 assert_own_property(SyncRegistration.prototype, 'unregister'); 34 assert_own_property(SyncRegistration.prototype, 'unregister');
23 35
24 }, 'SyncRegistration should be exposed and have the expected interface.'); 36 }, 'SyncRegistration should be exposed and have the expected interface.');
25 37
26 test(function() { 38 test(function() {
39 assert_own_property(self, 'PeriodicSyncRegistration', 'PeriodicSyncRegistrat ion needs to be exposed as a global.');
40
41 // FIXME: Assert existence of the attributes when they are properly
42 // exposed in the prototype chain. https://crbug.com/43394
43
44 assert_own_property(PeriodicSyncRegistration.prototype, 'unregister');
45
46 }, 'PeriodicSyncRegistration should be exposed and have the expected interface.' );
47
48 test(function() {
27 assert_own_property(self, 'SyncEvent'); 49 assert_own_property(self, 'SyncEvent');
28 50
29 var event = new SyncEvent('SyncEvent', {id: 'SyncEvent'}); 51 var event = new SyncEvent('SyncEvent', {tag: 'SyncEvent'});
30 assert_will_be_idl_attribute(event, 'registration'); 52 assert_will_be_idl_attribute(event, 'registration');
31 assert_equals(event.type, 'SyncEvent'); 53 assert_equals(event.type, 'SyncEvent');
32 54
33 // SyncEvent should be extending ExtendableEvent. 55 // SyncEvent should be extending ExtendableEvent.
34 assert_inherits(event, 'waitUntil'); 56 assert_inherits(event, 'waitUntil');
35 57
36 }, 'SyncEvent should be exposed and have the expected interface.'); 58 }, 'SyncEvent should be exposed and have the expected interface.');
37 59
60 test(function() {
61 assert_own_property(self, 'PeriodicSyncEvent');
62
63 var event = new PeriodicSyncEvent('PeriodicSyncEvent', {tag: 'PeriodicSyncEv ent'});
64 assert_will_be_idl_attribute(event, 'registration');
65 assert_equals(event.type, 'PeriodicSyncEvent');
66
67 // PeriodicSyncEvent should be extending ExtendableEvent.
68 assert_inherits(event, 'waitUntil');
69
70 }, 'PeriodicSyncEvent should be exposed and have the expected interface.');
71
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698