Update FileAPI WPT idlharness

This commit is contained in:
Zhen Zhang 2016-07-31 00:14:58 +02:00
parent 1ce4be8f6d
commit 612e15f05b
6 changed files with 55 additions and 28 deletions

View file

@ -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

View file

@ -75,15 +75,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

View file

@ -41,3 +41,4 @@
[Check forEach method]
expected: FAIL

View file

@ -5,3 +5,4 @@
[Headers forEach loop should stop if callback is throwing exception]
expected: FAIL

View file

@ -9,3 +9,4 @@
[Headers has values method]
expected: FAIL

View file

@ -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<BlobPart> 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<BlobPart> 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);
};