| OLD | NEW |
| 1 "use strict"; | 1 "use strict"; |
| 2 | 2 |
| 3 importScripts("/resources/testharness.js"); | 3 importScripts("/resources/testharness.js"); |
| 4 importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js"); | 4 importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js"); |
| 5 | 5 |
| 6 var request = new XMLHttpRequest(); | 6 async_test(function(t) { |
| 7 request.open("GET", "interfaces.idl"); | 7 var request = new XMLHttpRequest(); |
| 8 request.send(); | 8 request.open("GET", "interfaces.idl"); |
| 9 request.onload = function() { | 9 request.send(); |
| 10 var idlArray = new IdlArray(); | 10 request.onload = t.step_func(function() { |
| 11 var idls = request.responseText; | 11 var idlArray = new IdlArray(); |
| 12 var idls = request.responseText; |
| 12 | 13 |
| 13 idlArray.add_untested_idls("[Exposed=Worker] interface WorkerGlobalScope {};")
; | 14 // https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope |
| 14 idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface Event { };"); | 15 idlArray.add_untested_idls("[Exposed=Worker] interface WorkerGlobalScope {};
"); |
| 15 idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget {
};"); | |
| 16 | 16 |
| 17 // From Indexed DB: | 17 // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglob
alscope-mixin |
| 18 idlArray.add_idls("WorkerGlobalScope implements IDBEnvironment;"); | 18 idlArray.add_untested_idls(`[NoInterfaceObject, Exposed=(Window,Worker)] |
| 19 idlArray.add_idls(idls); | 19 interface WindowOrWorkerGlobalScope {};`); |
| 20 idlArray.add_untested_idls("WorkerGlobalScope implements WindowOrWorkerGloba
lScope;"); |
| 20 | 21 |
| 21 idlArray.add_objects({ | 22 // https://dom.spec.whatwg.org/#interface-event |
| 22 IDBCursor: [], | 23 idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface Event { };")
; |
| 23 IDBCursorWithValue: [], | 24 |
| 24 IDBDatabase: [], | 25 // https://dom.spec.whatwg.org/#interface-eventtarget |
| 25 IDBEnvironment: [], | 26 idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget
{ };"); |
| 26 IDBFactory: ["self.indexedDB"], | 27 |
| 27 IDBIndex: [], | 28 // From Indexed DB: |
| 28 IDBKeyRange: ["IDBKeyRange.only(0)"], | 29 idlArray.add_idls(idls); |
| 29 IDBObjectStore: [], | 30 |
| 30 IDBOpenDBRequest: [], | 31 idlArray.add_objects({ |
| 31 IDBRequest: [], | 32 IDBCursor: [], |
| 32 IDBTransaction: [], | 33 IDBCursorWithValue: [], |
| 33 IDBVersionChangeEvent: ["new IDBVersionChangeEvent('foo')"], | 34 IDBDatabase: [], |
| 35 IDBFactory: ["self.indexedDB"], |
| 36 IDBIndex: [], |
| 37 IDBKeyRange: ["IDBKeyRange.only(0)"], |
| 38 IDBObjectStore: [], |
| 39 IDBOpenDBRequest: [], |
| 40 IDBRequest: [], |
| 41 IDBTransaction: [], |
| 42 IDBVersionChangeEvent: ["new IDBVersionChangeEvent('foo')"], |
| 43 DOMStringList: [], |
| 44 }); |
| 45 idlArray.test(); |
| 46 t.done(); |
| 34 }); | 47 }); |
| 35 idlArray.test(); | 48 }); |
| 36 done(); | 49 |
| 37 }; | 50 done(); |
| OLD | NEW |