Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/interfaces-worker.sub.js |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/interfaces-worker.sub.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/interfaces-worker.sub.js |
index abb3417a4e50103c573b8e1cf9ff34b3bae801e9..ef333cb840037412c071749b1534d8515f472ec0 100644 |
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/interfaces-worker.sub.js |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/interfaces-worker.sub.js |
@@ -1,74 +1,32 @@ |
-importScripts('interfaces.js'); |
-importScripts('worker-testharness.js'); |
-importScripts('../resources/testharness-helpers.js'); |
- |
-var EVENT_HANDLER = 'object'; |
- |
-test(function() { |
- verify_interface('ServiceWorkerGlobalScope', |
- self, |
- { |
- clients: 'object', |
- registration: 'object', |
- skipWaiting: 'function', |
- |
- onactivate: EVENT_HANDLER, |
- onfetch: EVENT_HANDLER, |
- oninstall: EVENT_HANDLER, |
- onmessage: EVENT_HANDLER, |
- onmessageerror: EVENT_HANDLER |
- }); |
- }, 'ServiceWorkerGlobalScope'); |
- |
-test(function() { |
- verify_interface('Clients', |
- self.clients, |
- { |
- claim: 'function', |
- matchAll: 'function' |
- }); |
- }, 'Clients'); |
+'use strict'; |
-test(function() { |
- verify_interface('Client'); |
- // FIXME: Get an instance and test it, or ensure property exists on |
- // prototype. |
- }, 'Client'); |
- |
-test(function() { |
- verify_interface('WindowClient'); |
- // FIXME: Get an instance and test it, or ensure property exists on |
- // prototype. |
- }, 'WindowClient'); |
+importScripts('interfaces-idls.js'); |
+importScripts('worker-testharness.js'); |
+importScripts('/resources/WebIDLParser.js'); |
+importScripts('/resources/idlharness.js'); |
-test(function() { |
- verify_interface('CacheStorage', |
- self.caches, |
- { |
- match: 'function', |
- has: 'function', |
- open: 'function', |
- delete: 'function', |
- keys: 'function' |
- }); |
- }, 'CacheStorage'); |
+var idlArray = new IdlArray(); |
+idlArray.add_untested_idls(idls.untested); |
+idlArray.add_idls(idls.tested); |
+idlArray.add_objects({ |
+ ServiceWorkerGlobalScope: ['self'], |
+ Clients: ['self.clients'], |
+ ServiceWorkerRegistration: ['self.registration'], |
+ CacheStorage: ['self.caches'] |
+ // TODO: Test instances of Client and WindowClient, e.g. |
+ // Client: ['self.clientInstance'], |
+ // WindowClient: ['self.windowClientInstance'] |
+ }); |
promise_test(function(t) { |
return create_temporary_cache(t) |
.then(function(cache) { |
- verify_interface('Cache', |
- cache, |
- { |
- match: 'function', |
- matchAll: 'function', |
- add: 'function', |
- addAll: 'function', |
- put: 'function', |
- delete: 'function', |
- keys: 'function' |
- }); |
+ self.cacheInstance = cache; |
+ |
+ idlArray.add_objects({ Cache: ['self.cacheInstance'] }); |
+ idlArray.test(); |
}); |
- }, 'Cache'); |
+ }, 'test setup (cache creation)'); |
test(function() { |
var req = new Request('http://{{host}}/', |