diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/entries-api/idlharness-manual.window.js | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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'], + }); + } +); |