diff options
Diffstat (limited to 'testing/web-platform/tests/entries-api/idlharness-manual.window.js')
-rw-r--r-- | testing/web-platform/tests/entries-api/idlharness-manual.window.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/web-platform/tests/entries-api/idlharness-manual.window.js b/testing/web-platform/tests/entries-api/idlharness-manual.window.js new file mode 100644 index 0000000000..9f2731bf1d --- /dev/null +++ b/testing/web-platform/tests/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'], + }); + } +); |