Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (270007 => 270008)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-11-19 03:16:53 UTC (rev 270007)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-11-19 03:17:53 UTC (rev 270008)
@@ -1,5 +1,38 @@
2020-11-18 Chris Dumez <[email protected]>
+ Import web-platform-tests/entries-api tests from usptream
+ https://bugs.webkit.org/show_bug.cgi?id=219127
+
+ Reviewed by Sam Weinig.
+
+ Import web-platform-tests/entries-api tests from usptream dd35c2b21b76772123f76a1.
+
+ * resources/import-expectations.json:
+ * web-platform-tests/entries-api/META.yml: Added.
+ * web-platform-tests/entries-api/README.md: Added.
+ * web-platform-tests/entries-api/idlharness.window-expected.txt: Added.
+ * web-platform-tests/entries-api/idlharness.window.html: Added.
+ * web-platform-tests/entries-api/idlharness.window.js: Added.
+ * web-platform-tests/entries-api/support.js: Added.
+ (entry_test):
+ (getEntriesAsPromise):
+ * web-platform-tests/entries-api/support/a/b/c/3.txt: Added.
+ * web-platform-tests/entries-api/support/a/b/c/d/1.txt: Added.
+ * web-platform-tests/entries-api/support/a/b/c/d/2.txt: Added.
+ * web-platform-tests/entries-api/support/a/b/c/d/w3c-import.log: Added.
+ * web-platform-tests/entries-api/support/a/b/c/w3c-import.log: Added.
+ * web-platform-tests/entries-api/support/upload.txt: Added.
+ * web-platform-tests/entries-api/support/upload/file.txt: Added.
+ * web-platform-tests/entries-api/support/upload/subdir/1.txt: Added.
+ * web-platform-tests/entries-api/support/upload/subdir/2.txt: Added.
+ * web-platform-tests/entries-api/support/upload/subdir/3.txt: Added.
+ * web-platform-tests/entries-api/support/upload/subdir/w3c-import.log: Added.
+ * web-platform-tests/entries-api/support/upload/w3c-import.log: Added.
+ * web-platform-tests/entries-api/support/w3c-import.log: Added.
+ * web-platform-tests/entries-api/w3c-import.log: Added.
+
+2020-11-18 Chris Dumez <[email protected]>
+
Resync web-platform-tests/WebIDL tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=219120
Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (270007 => 270008)
--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2020-11-19 03:16:53 UTC (rev 270007)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json 2020-11-19 03:17:53 UTC (rev 270008)
@@ -193,7 +193,7 @@
"web-platform-tests/encoding": "import",
"web-platform-tests/encrypted-media": "import",
"web-platform-tests/encrypted-media/Google": "skip",
- "web-platform-tests/entries-api": "skip",
+ "web-platform-tests/entries-api": "import",
"web-platform-tests/eventsource": "import",
"web-platform-tests/ext-xhtml-pubid": "skip",
"web-platform-tests/feature-policy": "skip",
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/META.yml (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/META.yml (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/META.yml 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,4 @@
+spec: https://wicg.github.io/entries-api/
+suggested_reviewers:
+ - aliams
+ - inexorabletash
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/README.md (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/README.md (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/README.md 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,9 @@
+Tests for the [Files and Directory Entries API](https://github.com/wicg/entries-api)
+
+* [Explainer](https://github.com/WICG/entries-api/blob/gh-pages/EXPLAINER.md)
+* [Draft Specification](https://wicg.github.io/entries-api/)
+
+Unfortunately, most of the tests are **manual** and require drag-and-drop of test
+data files, which can be found in the `entries-api/support` directory. The tests
+can be run via [w3c-test.org](http://w3c-test.org/entries-api/), but a local clone
+of the repo is required for access to the test data files.
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window-expected.txt (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window-expected.txt 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,69 @@
+
+PASS idl_test setup
+PASS idl_test validation
+PASS Partial interface File: original interface defined
+PASS Partial interface File: member names are unique
+PASS Partial interface HTMLInputElement: original interface defined
+PASS Partial interface HTMLInputElement: member names are unique
+PASS Partial interface DataTransferItem: original interface defined
+PASS Partial interface DataTransferItem: member names are unique
+PASS Partial interface HTMLInputElement[2]: member names are unique
+PASS HTMLElement includes GlobalEventHandlers: member names are unique
+PASS HTMLElement includes DocumentAndElementEventHandlers: member names are unique
+PASS HTMLElement includes ElementContentEditable: member names are unique
+PASS HTMLElement includes HTMLOrSVGElement: member names are unique
+PASS Element includes ParentNode: member names are unique
+PASS Element includes NonDocumentTypeChildNode: member names are unique
+PASS Element includes ChildNode: member names are unique
+PASS Element includes Slottable: member names are unique
+PASS FileSystemEntry interface: existence and properties of interface object
+PASS FileSystemEntry interface object length
+PASS FileSystemEntry interface object name
+PASS FileSystemEntry interface: existence and properties of interface prototype object
+PASS FileSystemEntry interface: existence and properties of interface prototype object's "constructor" property
+PASS FileSystemEntry interface: existence and properties of interface prototype object's @@unscopables property
+PASS FileSystemEntry interface: attribute isFile
+PASS FileSystemEntry interface: attribute isDirectory
+PASS FileSystemEntry interface: attribute name
+PASS FileSystemEntry interface: attribute fullPath
+PASS FileSystemEntry interface: attribute filesystem
+PASS FileSystemEntry interface: operation getParent(optional FileSystemEntryCallback, optional ErrorCallback)
+PASS FileSystemDirectoryEntry interface: existence and properties of interface object
+PASS FileSystemDirectoryEntry interface object length
+PASS FileSystemDirectoryEntry interface object name
+PASS FileSystemDirectoryEntry interface: existence and properties of interface prototype object
+PASS FileSystemDirectoryEntry interface: existence and properties of interface prototype object's "constructor" property
+PASS FileSystemDirectoryEntry interface: existence and properties of interface prototype object's @@unscopables property
+PASS FileSystemDirectoryEntry interface: operation createReader()
+PASS FileSystemDirectoryEntry interface: operation getFile(optional USVString?, optional FileSystemFlags, optional FileSystemEntryCallback, optional ErrorCallback)
+PASS FileSystemDirectoryEntry interface: operation getDirectory(optional USVString?, optional FileSystemFlags, optional FileSystemEntryCallback, optional ErrorCallback)
+PASS FileSystemDirectoryReader interface: existence and properties of interface object
+PASS FileSystemDirectoryReader interface object length
+PASS FileSystemDirectoryReader interface object name
+PASS FileSystemDirectoryReader interface: existence and properties of interface prototype object
+PASS FileSystemDirectoryReader interface: existence and properties of interface prototype object's "constructor" property
+PASS FileSystemDirectoryReader interface: existence and properties of interface prototype object's @@unscopables property
+PASS FileSystemDirectoryReader interface: operation readEntries(FileSystemEntriesCallback, optional ErrorCallback)
+PASS FileSystemFileEntry interface: existence and properties of interface object
+PASS FileSystemFileEntry interface object length
+PASS FileSystemFileEntry interface object name
+PASS FileSystemFileEntry interface: existence and properties of interface prototype object
+PASS FileSystemFileEntry interface: existence and properties of interface prototype object's "constructor" property
+PASS FileSystemFileEntry interface: existence and properties of interface prototype object's @@unscopables property
+PASS FileSystemFileEntry interface: operation file(FileCallback, optional ErrorCallback)
+PASS FileSystem interface: existence and properties of interface object
+PASS FileSystem interface object length
+PASS FileSystem interface object name
+PASS FileSystem interface: existence and properties of interface prototype object
+PASS FileSystem interface: existence and properties of interface prototype object's "constructor" property
+PASS FileSystem interface: existence and properties of interface prototype object's @@unscopables property
+PASS FileSystem interface: attribute name
+PASS FileSystem interface: attribute root
+PASS File interface: attribute webkitRelativePath
+PASS File interface: new File([], "example.txt") must inherit property "webkitRelativePath" with the proper type
+PASS HTMLInputElement interface: attribute webkitdirectory
+PASS HTMLInputElement interface: attribute webkitEntries
+PASS HTMLInputElement interface: document.createElement("input") must inherit property "webkitdirectory" with the proper type
+PASS HTMLInputElement interface: document.createElement("input") must inherit property "webkitEntries" with the proper type
+PASS DataTransferItem interface: operation webkitGetAsEntry()
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window.html (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window.html 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window.js (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window.js 2020-11-19 03:17:53 UTC (rev 270008)
@@ -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")'],
+ });
+ }
+);
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/3.txt ( => )
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/d/1.txt
===================================================================
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/d/2.txt ( => )
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/d/w3c-import.log
===================================================================
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/d/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/d/w3c-import.log 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,18 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/d/1.txt
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/d/2.txt
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/w3c-import.log (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/w3c-import.log 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,17 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/a/b/c/3.txt
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/file.txt ( => )
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/1.txt
===================================================================
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/2.txt ( => )
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/3.txt
===================================================================
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/w3c-import.log (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/w3c-import.log 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,19 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/1.txt
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/2.txt
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/subdir/3.txt
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/w3c-import.log (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/w3c-import.log 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,17 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload/file.txt
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload.txt ( => )
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/w3c-import.log
===================================================================
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/w3c-import.log 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,17 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support/upload.txt
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support.js (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/support.js 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,131 @@
+// ----------------------------------------
+// Test Utilities
+// ----------------------------------------
+
+setup({explicit_timeout: true});
+
+const tests = [];
+window.addEventListener('DOMContentLoaded', e => {
+ const header = document.createElement('h1');
+ header.innerText = document.title;
+ document.body.appendChild(header);
+ const elem = document.createElement('div');
+ elem.style.cssText = 'height: 50px; border: 1px dotted red;';
+ elem.innerHTML = 'Drop the <b>support/upload</b> directory here.</div>';
+ document.body.appendChild(elem);
+ elem.addEventListener('dragover', e => {
+ e.preventDefault();
+ });
+ elem.addEventListener('drop', e => {
+ e.preventDefault();
+ for (let i = 0; i < e.dataTransfer.items.length; ++i) {
+ const item = e.dataTransfer.items[i];
+ if (item.kind !== 'file')
+ continue;
+ const entry = item.webkitGetAsEntry();
+ elem.parentElement.removeChild(elem);
+ tests.forEach(f => f(entry, item));
+ break;
+ }
+ });
+});
+
+
+// Registers a test to be run when an entry is dropped. Calls |func|
+// with (test, entry, item); |func| must call `test.done()` when complete.
+function entry_test(func, description) {
+ const test = async_test(description);
+ tests.push(test.step_func((entry, item) => func(test, entry, item)));
+}
+
+// Registers a test to be run when an entry is dropped. Digs the named
+// |file| out of the dropped entry and calls |func| with
+// (test, file_entry); |func| must call `test.done()` when complete.
+function file_entry_test(name, func, description) {
+ return entry_test((t, entry, item) => {
+ getChildEntry(entry, name,
+ t.step_func((entry) => func(t, entry)),
+ t.unreached_func('Did not find expected file: ' + name));
+ }, description);
+}
+
+
+// ----------------------------------------
+// Paths
+// ----------------------------------------
+
+const INVALID_PATHS = [
+ '\x00', 'a-\x00-b',
+ '\\', 'a-\\-b'
+];
+const EMPTY_PATHS = ['', null, undefined];
+const NOT_FOUND_PATHS = [
+ 'nope',
+ '/upload/nope',
+ './nope',
+ 'subdir/../nope',
+ '\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f',
+ '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f',
+];
+
+const DIR_PATHS = [
+ 'subdir',
+ '/upload/subdir',
+ './subdir',
+ 'subdir/.',
+ 'subdir/../subdir',
+ 'subdir/./../subdir',
+ 'subdir/../subdir/.',
+ '//upload/subdir',
+ '/upload//subdir',
+ './/subdir',
+ 'subdir//.',
+];
+const FILE_PATHS = [
+ 'file.txt',
+ '/upload/file.txt',
+ 'subdir/../file.txt',
+ '//upload/file.txt',
+ '/upload//file.txt',
+ 'subdir/./../file.txt',
+];
+
+// ----------------------------------------
+// Helpers
+// ----------------------------------------
+
+// Wrapper for FileSystemDirectoryReader that yields all entries via a
+// Promise.
+
+function getEntriesAsPromise(dirEntry) {
+ return new Promise((resolve, reject) => {
+ const result = [];
+ const reader = dirEntry.createReader();
+ const doBatch = () => {
+ reader.readEntries(entries => {
+ if (entries.length > 0) {
+ entries.forEach(e => result.push(e));
+ doBatch();
+ } else {
+ resolve(result);
+ }
+ }, reject);
+ };
+ doBatch();
+ });
+}
+
+
+// Wrapper for FileSystemDirectoryReader that yields a single entry by
+// name via a callback. Can be used instead of getFile() or
+// getDirectory() since not all implementations support those.
+
+function getChildEntry(dirEntry, name, callback, errback) {
+ getEntriesAsPromise(dirEntry)
+ .then(entries => {
+ const entry = entries.filter(entry => entry.name === name)[0];
+ if (!entry)
+ throw new Error('No such file: ' + name);
+ return entry;
+ }).then(callback, errback);
+}
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/w3c-import.log (0 => 270008)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/w3c-import.log (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/entries-api/w3c-import.log 2020-11-19 03:17:53 UTC (rev 270008)
@@ -0,0 +1,21 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+ https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/META.yml
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/README.md
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness-manual.window.js
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/idlharness.window.js
+/LayoutTests/imported/w3c/web-platform-tests/entries-api/support.js