diff --git a/entries-api/idlharness-manual.html b/entries-api/idlharness-manual.html deleted file mode 100644 index 72bdf67dfa678b..00000000000000 --- a/entries-api/idlharness-manual.html +++ /dev/null @@ -1,54 +0,0 @@ - - -Entries API: IDL Tests - - - - - - - diff --git a/entries-api/idlharness-manual.window.js b/entries-api/idlharness-manual.window.js new file mode 100644 index 00000000000000..9f2731bf1d0257 --- /dev/null +++ b/entries-api/idlharness-manual.window.js @@ -0,0 +1,46 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js +// META: script=support.js + +'use strict'; + +let resolve; +let globalItem; +let globalEntry; + +let entriesPromise = new Promise(r => { + resolve = r; +}); + +entry_test((t, entry, item) => { + assert_true(entry.isDirectory); + resolve(getEntriesAsPromise(entry)); + globalItem = item; + globalEntry = entry; + t.done(); +}); + +idl_test( + ['entries-api'], + ['FileAPI', 'html', 'dom'], + async idl_array => { + const entries = await entriesPromise; + window.samples = { + item: globalItem, + dirEntry: entries.filter(entry => entry.isDirectory)[0], + fileEntry: entries.filter(entry => entry.isFile)[0], + fileSystem: globalEntry.filesystem, + }; + + idl_array.add_objects({ + File: ['new File([], "example.txt")'], + HTMLInputElement: ['document.createElement("input")'], + DataTransferItem: ['samples.item'], + FileSystemEntry: [], + FileSystemDirectoryEntry: ['samples.dirEntry'], + FileSystemDirectoryReader: ['samples.dirEntry.createReader()'], + FileSystemFileEntry: ['samples.fileEntry'], + FileSystem: ['samples.fileSystem'], + }); + } +); diff --git a/entries-api/idlharness.html b/entries-api/idlharness.html deleted file mode 100644 index 091549eb2dcb57..00000000000000 --- a/entries-api/idlharness.html +++ /dev/null @@ -1,39 +0,0 @@ - - -Entries API: IDL Tests - - - - - - diff --git a/entries-api/idlharness.window.js b/entries-api/idlharness.window.js new file mode 100644 index 00000000000000..32527be514ad92 --- /dev/null +++ b/entries-api/idlharness.window.js @@ -0,0 +1,15 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +'use strict'; + +idl_test( + ['entries-api'], + ['FileAPI', 'html', 'dom'], + idl_array => { + idl_array.add_objects({ + File: ['new File([], "example.txt")'], + HTMLInputElement: ['document.createElement("input")'], + }); + } +);