fune/testing/web-platform/tests/FileAPI/idlharness.worker.js
Luke Bjerring 859fbc17c9 Bug 1467961 [wpt PR 11441] - Clean up FileAPI idlharness tests, a=testonly
Automatic update from web-platform-testsClean up FileAPI idlharness tests

After fixing #10338, we can leverage add_dependency_idls to import the 'real' untested idl from sources cleanly.
--

wpt-commits: ce580dab49d64f723453cf56c2c501bb54beb7bc
wpt-pr: 11441
2018-07-11 07:49:13 +01:00

25 lines
967 B
JavaScript

importScripts("/resources/testharness.js");
importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js");
promise_test(async () => {
const idl = await fetch('/interfaces/FileAPI.idl').then(r => r.text());
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
const html = await fetch('/interfaces/html.idl').then(r => r.text());
const url = await fetch('/interfaces/url.idl').then(r => r.text());
const idl_array = new IdlArray();
idl_array.add_idls(idl);
idl_array.add_dependency_idls(dom);
idl_array.add_dependency_idls(html);
idl_array.add_dependency_idls(url);
idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface ArrayBuffer {};");
idl_array.add_objects({
Blob: ['new Blob(["TEST"])'],
File: ['new File(["myFileBits"], "myFileName")'],
FileReader: ['new FileReader()'],
FileReaderSync: ['new FileReaderSync()']
});
idl_array.test();
}, 'Test FileAPI IDL implementation');
done();