Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / background_sync / interfaces.html
blobcd4ef6f53d3a7181ada0e212f3e55a61c418f188
1 <!doctype html>
2 <html>
3 <head>
4 <title>Background Sync API: Verifies that the right Background Sync API interfaces get exposed.</title>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 </head>
9 <body>
10 <script>
11 // Tests that the expected Background Sync API interfaces are being exposed on both
12 // the Service Worker and Document global scopes.
13 service_worker_test(
14 'resources/interfaces-worker.js',
15 'Exposure of interfaces in a Service Worker.');
17 test(function() {
18 assert_own_property(self, 'SyncManager', 'SyncManager needs to be exposed as a global.');
20 assert_own_property(SyncManager.prototype, 'register');
21 assert_own_property(SyncManager.prototype, 'getRegistration');
22 assert_own_property(SyncManager.prototype, 'getRegistrations');
23 assert_own_property(SyncManager.prototype, 'permissionState');
25 }, 'SyncManager should be exposed and have the expected interface in a Document.');
27 test(function() {
28 assert_own_property(self, 'SyncRegistration', 'SyncRegistration needs to be exposed as a global.');
30 // FIXME: Assert existence of the attributes when they are properly
31 // exposed in the prototype chain. https://crbug.com/43394
33 assert_own_property(SyncRegistration.prototype, 'done');
34 assert_own_property(SyncRegistration.prototype, 'unregister');
35 assert_own_property(SyncRegistration.prototype, 'tag');
37 }, 'SyncRegistration should be exposed and have the expected interface in a Document.');
38 </script>
39 </body>
40 </html>