diff --git a/tests/wpt/metadata/FileAPI/idlharness.html.ini b/tests/wpt/metadata/FileAPI/idlharness.html.ini index 1957439c798..a2b56459bec 100644 --- a/tests/wpt/metadata/FileAPI/idlharness.html.ini +++ b/tests/wpt/metadata/FileAPI/idlharness.html.ini @@ -30,3 +30,12 @@ [FileReader interface: calling readAsArrayBuffer(Blob) on new FileReader() with too few arguments must throw TypeError] expected: FAIL + [FileReader interface: operation readAsBinaryString(Blob)] + expected: FAIL + + [FileReader interface: new FileReader() must inherit property "readAsBinaryString" with the proper type (1)] + expected: FAIL + + [FileReader interface: calling readAsBinaryString(Blob) on new FileReader() with too few arguments must throw TypeError] + expected: FAIL + diff --git a/tests/wpt/metadata/FileAPI/idlharness.worker.js.ini b/tests/wpt/metadata/FileAPI/idlharness.worker.js.ini index 65c6bf4be78..1c1a2484345 100644 --- a/tests/wpt/metadata/FileAPI/idlharness.worker.js.ini +++ b/tests/wpt/metadata/FileAPI/idlharness.worker.js.ini @@ -54,15 +54,27 @@ [Event interface: existence and properties of interface object] expected: FAIL - [Blob interface: existence and properties of interface object] + [FileReader interface: operation readAsBinaryString(Blob)] expected: FAIL - [File interface: existence and properties of interface object] + [FileReader interface: new FileReader() must inherit property "readAsBinaryString" with the proper type (1)] expected: FAIL - [FileList interface: existence and properties of interface object] + [FileReader interface: calling readAsBinaryString(Blob) on new FileReader() with too few arguments must throw TypeError] expected: FAIL - [FileReader interface: existence and properties of interface object] + [FileReaderSync interface: operation readAsBinaryString(Blob)] + expected: FAIL + + [FileReaderSync interface: new FileReaderSync() must inherit property "readAsBinaryString" with the proper type (1)] + expected: FAIL + + [FileReaderSync interface: calling readAsBinaryString(Blob) on new FileReaderSync() with too few arguments must throw TypeError] + expected: FAIL + + [FileReaderSync interface: new FileReaderSync() must inherit property "readAsText" with the proper type (2)] + expected: FAIL + + [FileReaderSync interface: new FileReaderSync() must inherit property "readAsDataURL" with the proper type (3)] expected: FAIL diff --git a/tests/wpt/web-platform-tests/FileAPI/idlharness.idl b/tests/wpt/web-platform-tests/FileAPI/idlharness.idl index 62e6c5d9f21..d8f31b43a80 100644 --- a/tests/wpt/web-platform-tests/FileAPI/idlharness.idl +++ b/tests/wpt/web-platform-tests/FileAPI/idlharness.idl @@ -1,5 +1,7 @@ -[Constructor, - Constructor(sequence<(ArrayBuffer or ArrayBufferView or Blob or DOMString)> blobParts, optional BlobPropertyBag options), Exposed=Window,Worker] +// https://w3c.github.io/FileAPI/#idl-index + +[Constructor(optional sequence blobParts, optional BlobPropertyBag options), +Exposed=(Window,Worker)] interface Blob { readonly attribute unsigned long long size; @@ -9,8 +11,8 @@ interface Blob { //slice Blob into byte-ranged chunks Blob slice([Clamp] optional long long start, - [Clamp] optional long long end, - optional DOMString contentType); + [Clamp] optional long long end, + optional DOMString contentType); void close(); }; @@ -19,32 +21,33 @@ dictionary BlobPropertyBag { DOMString type = ""; }; -[Constructor(sequence<(Blob or DOMString or ArrayBufferView or ArrayBuffer)> fileBits, -[EnsureUTF16] DOMString fileName, optional FilePropertyBag options), Exposed=Window,Worker] -interface File : Blob { +typedef (BufferSource or Blob or USVString) BlobPart; +[Constructor(sequence fileBits, + [EnsureUTF16] DOMString fileName, + optional FilePropertyBag options), +Exposed=(Window,Worker)] +interface File : Blob { readonly attribute DOMString name; readonly attribute long long lastModified; - }; -dictionary FilePropertyBag { - - DOMString type = ""; +dictionary FilePropertyBag : BlobPropertyBag { long long lastModified; - }; -[Exposed=Window,Worker] interface FileList { +[Exposed=(Window,Worker)] +interface FileList { getter File? item(unsigned long index); readonly attribute unsigned long length; }; -[Constructor, Exposed=Window,Worker] +[Constructor, Exposed=(Window,Worker)] interface FileReader: EventTarget { // async read methods void readAsArrayBuffer(Blob blob); + void readAsBinaryString(Blob blob); void readAsText(Blob blob, optional DOMString label); void readAsDataURL(Blob blob); @@ -55,6 +58,7 @@ interface FileReader: EventTarget { const unsigned short LOADING = 1; const unsigned short DONE = 2; + readonly attribute unsigned short readyState; // File or Blob data @@ -62,7 +66,7 @@ interface FileReader: EventTarget { readonly attribute DOMError? error; - // event handler attributes + // event handler content attributes attribute EventHandler onloadstart; attribute EventHandler onprogress; attribute EventHandler onload; @@ -72,20 +76,19 @@ interface FileReader: EventTarget { }; -partial interface URL { - - static DOMString createObjectURL(Blob blob); - static DOMString createFor(Blob blob); - static void revokeObjectURL(DOMString url); - -}; - [Constructor, Exposed=Worker] interface FileReaderSync { - // Synchronously return strings ArrayBuffer readAsArrayBuffer(Blob blob); + DOMString readAsBinaryString(Blob blob); DOMString readAsText(Blob blob, optional DOMString label); DOMString readAsDataURL(Blob blob); }; + +[Exposed=(Window,DedicatedWorker,SharedWorker)] +partial interface URL { + static DOMString createObjectURL(Blob blob); + static DOMString createFor(Blob blob); + static void revokeObjectURL(DOMString url); +};