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

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: Unregister method requires the sync registration tag 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
« no previous file with comments | « no previous file | LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698