1 importScripts('interfaces.js');
2 importScripts('worker-testharness.js');
3 importScripts('/resources/testharness-helpers.js');
5 var EVENT_HANDLER = 'object';
8 verify_interface('ServiceWorkerGlobalScope',
13 registration: 'object',
14 skipWaiting: 'function',
16 onactivate: EVENT_HANDLER,
17 onfetch: EVENT_HANDLER,
18 oninstall: EVENT_HANDLER,
19 onmessage: EVENT_HANDLER
21 }, 'ServiceWorkerGlobalScope');
24 verify_interface('Clients',
33 verify_interface('Client');
34 // FIXME: Get an instance and test it, or ensure property exists on
39 verify_interface('WindowClient');
40 // FIXME: Get an instance and test it, or ensure property exists on
45 verify_interface('CacheStorage',
56 promise_test(function(t) {
57 return create_temporary_cache(t)
58 .then(function(cache) {
59 verify_interface('Cache',
75 new ExtendableEvent('ExtendableEvent').type,
76 'ExtendableEvent', 'Type of ExtendableEvent should be ExtendableEvent');
78 new FetchEvent('FetchEvent').type,
79 'FetchEvent', 'Type of FetchEvent should be FetchEvent');
81 new FetchEvent('FetchEvent').cancelable,
82 false, 'Default FetchEvent.cancelable should be false');
84 new FetchEvent('FetchEvent').bubbles,
85 false, 'Default FetchEvent.bubbles should be false');
87 new FetchEvent('FetchEvent').isReload,
88 false, 'Default FetchEvent.isReload should be false');
90 new FetchEvent('FetchEvent', {cancelable: false}).cancelable,
91 false, 'FetchEvent.cancelable should be false');
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'});
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');