Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / serviceworker / resources / interfaces-worker.js
blob67d99183a55596d38d9becff6f17841eca93634e
1 importScripts('interfaces.js');
2 importScripts('worker-testharness.js');
3 importScripts('/resources/testharness-helpers.js');
5 var EVENT_HANDLER = 'object';
7 test(function() {
8     verify_interface('ServiceWorkerGlobalScope',
9                      self,
10                      {
11                        clients: 'object',
12                        close: 'function',
13                        registration: 'object',
14                        skipWaiting: 'function',
16                        onactivate: EVENT_HANDLER,
17                        onfetch: EVENT_HANDLER,
18                        oninstall: EVENT_HANDLER,
19                        onmessage: EVENT_HANDLER
20                      });
21   }, 'ServiceWorkerGlobalScope');
23 test(function() {
24     verify_interface('Clients',
25                      self.clients,
26                      {
27                        claim: 'function',
28                        matchAll: 'function'
29                      });
30   }, 'Clients');
32 test(function() {
33     verify_interface('Client');
34     // FIXME: Get an instance and test it, or ensure property exists on
35     // prototype.
36   }, 'Client');
38 test(function() {
39     verify_interface('WindowClient');
40     // FIXME: Get an instance and test it, or ensure property exists on
41     // prototype.
42   }, 'WindowClient');
44 test(function() {
45     verify_interface('CacheStorage',
46                      self.caches,
47                      {
48                        match: 'function',
49                        has: 'function',
50                        open: 'function',
51                        delete: 'function',
52                        keys: 'function'
53                      });
54   }, 'CacheStorage');
56 promise_test(function(t) {
57     return create_temporary_cache(t)
58       .then(function(cache) {
59           verify_interface('Cache',
60                            cache,
61                            {
62                              match: 'function',
63                              matchAll: 'function',
64                              add: 'function',
65                              addAll: 'function',
66                              put: 'function',
67                              delete: 'function',
68                              keys: 'function'
69                            });
70         });
71   }, 'Cache');
73 test(function() {
74     assert_equals(
75       new ExtendableEvent('ExtendableEvent').type,
76       'ExtendableEvent', 'Type of ExtendableEvent should be ExtendableEvent');
77     assert_equals(
78       new FetchEvent('FetchEvent').type,
79       'FetchEvent', 'Type of FetchEvent should be FetchEvent');
80     assert_equals(
81       new FetchEvent('FetchEvent').cancelable,
82       false, 'Default FetchEvent.cancelable should be false');
83     assert_equals(
84       new FetchEvent('FetchEvent').bubbles,
85       false, 'Default FetchEvent.bubbles should be false');
86     assert_equals(
87       new FetchEvent('FetchEvent').isReload,
88       false, 'Default FetchEvent.isReload should be false');
89     assert_equals(
90       new FetchEvent('FetchEvent', {cancelable: false}).cancelable,
91       false, 'FetchEvent.cancelable should be false');
92     assert_equals(
93       new FetchEvent('FetchEvent', {isReload : true}).isReload, true,
94       'FetchEvent.isReload with option {isReload : true} should be true');
95     var req = new Request('https://www.example.com/', {method: 'POST'});
96     assert_equals(
97       new FetchEvent('FetchEvent', {request: req, isReload: true}).request.url,
98       'https://www.example.com/',
99       'FetchEvent.request.url should return the value it was initialized to');
100   }, 'Event constructors');