Implement FileReader.{readAsText,readAsDataUrl}. Fixes #6172

This commit is contained in:
farodin91 2015-07-23 22:33:51 +02:00
parent f44d75e5b2
commit 27e760e28d
20 changed files with 565 additions and 326 deletions

View file

@ -1,5 +0,0 @@
[Progress_event_bubbles_cancelable.html]
type: testharness
[Check the values of bubbles and cancelable are false when the progress event is dispatched]
expected: FAIL

View file

@ -9,9 +9,6 @@
[A plain object with a length property should be treated as a sequence for the blobParts argument.]
expected: FAIL
[A String object should be treated as a sequence for the blobParts argument.]
expected: FAIL
[A Uint8Array object should be treated as a sequence for the blobParts argument.]
expected: FAIL
@ -48,9 +45,6 @@
[Passing an element as the blobParts array should work.]
expected: FAIL
[Passing an platform object that supports indexed properties as the blobParts array should work (window).]
expected: FAIL
[Passing an platform object that supports indexed properties as the blobParts array should work (window with custom toString).]
expected: FAIL
@ -75,45 +69,3 @@
[Array with mixed types]
expected: FAIL
[Passing null (index 0) for options should use the defaults.]
expected: FAIL
[Passing null (index 0) for options should use the defaults (with newlines).]
expected: FAIL
[Passing undefined (index 1) for options should use the defaults.]
expected: FAIL
[Passing undefined (index 1) for options should use the defaults (with newlines).]
expected: FAIL
[Passing object "[object Object\]" (index 2) for options should use the defaults.]
expected: FAIL
[Passing object "[object Object\]" (index 2) for options should use the defaults (with newlines).]
expected: FAIL
[Passing object "[object Object\]" (index 3) for options should use the defaults.]
expected: FAIL
[Passing object "[object Object\]" (index 3) for options should use the defaults (with newlines).]
expected: FAIL
[Passing object "/regex/" (index 4) for options should use the defaults.]
expected: FAIL
[Passing object "/regex/" (index 4) for options should use the defaults (with newlines).]
expected: FAIL
[Passing function "function () {}" (index 5) for options should use the defaults.]
expected: FAIL
[Passing function "function () {}" (index 5) for options should use the defaults (with newlines).]
expected: FAIL
[Newlines should not change when endings is 'transparent'.]
expected: FAIL
[Newlines should not change when endings is 'native'.]
expected: FAIL

View file

@ -1,47 +1,8 @@
[Blob-slice.html]
type: testharness
[no-argument Blob slice]
expected: FAIL
[blob1.]
expected: FAIL
[blob2.]
expected: FAIL
[Slicing test: slice (0,0).]
expected: FAIL
[Slicing test: slice (0,1).]
expected: FAIL
[Slicing test: slice (0,2).]
expected: FAIL
[Slicing test: slice (0,3).]
expected: FAIL
[Slicing test: slice (0,4).]
expected: FAIL
[Slicing test: slice (0,5).]
expected: FAIL
[Slicing test: slice (0,6).]
expected: FAIL
[Slicing test: slice (0,7).]
expected: FAIL
[Slicing test: slice (0,8).]
expected: FAIL
[Slicing test: slice (1,0).]
expected: FAIL
[Slicing test: slice (1,1).]
expected: FAIL
[Slicing test: slice (1,2).]
expected: FAIL
@ -60,9 +21,6 @@
[Slicing test: slice (1,7).]
expected: FAIL
[Slicing test: slice (2,0).]
expected: FAIL
[Slicing test: slice (2,1).]
expected: FAIL
@ -87,9 +45,6 @@
[Slicing test: slice (3,4).]
expected: FAIL
[Slicing test: slice (3,5).]
expected: FAIL
[Slicing test: slice (4,0).]
expected: FAIL
@ -150,9 +105,6 @@
[Slicing test: slice (8,3).]
expected: FAIL
[Invalid contentType ("ÿ")]
expected: FAIL
[Invalid contentType ("te(xt/plain")]
expected: FAIL
@ -207,24 +159,3 @@
[Invalid contentType ("te xt/plain")]
expected: FAIL
[Invalid contentType ("te\\txt/plain")]
expected: FAIL
[Invalid contentType ("te\\0xt/plain")]
expected: FAIL
[Invalid contentType ("te\\x1fxt/plain")]
expected: FAIL
[Invalid contentType ("text/plain")]
expected: FAIL
[Valid contentType ("TEXT/PLAIN")]
expected: FAIL
[Valid contentType ("text/plain;charset = UTF-8")]
expected: FAIL
[Valid contentType ("text/plain;charset=UTF-8")]
expected: FAIL

View file

@ -1,11 +1,5 @@
[fileReader.html]
type: testharness
[FileReader interface object]
expected: FAIL
[no-argument FileReader constructor]
expected: FAIL
[FileReader States -- abort]
expected: FAIL

View file

@ -1,5 +0,0 @@
[historical.html]
type: testharness
[FileReader should not support readAsBinaryString]
expected: FAIL

View file

@ -96,135 +96,6 @@
[FileReader interface: existence and properties of interface object]
expected: FAIL
[FileReader interface object length]
expected: FAIL
[FileReader interface: existence and properties of interface prototype object]
expected: FAIL
[FileReader interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[FileReader interface: operation readAsArrayBuffer(Blob)]
expected: FAIL
[FileReader interface: operation readAsText(Blob,DOMString)]
expected: FAIL
[FileReader interface: operation readAsDataURL(Blob)]
expected: FAIL
[FileReader interface: operation abort()]
expected: FAIL
[FileReader interface: constant EMPTY on interface object]
expected: FAIL
[FileReader interface: constant EMPTY on interface prototype object]
expected: FAIL
[FileReader interface: constant LOADING on interface object]
expected: FAIL
[FileReader interface: constant LOADING on interface prototype object]
expected: FAIL
[FileReader interface: constant DONE on interface object]
expected: FAIL
[FileReader interface: constant DONE on interface prototype object]
expected: FAIL
[FileReader interface: attribute readyState]
expected: FAIL
[FileReader interface: attribute result]
expected: FAIL
[FileReader interface: attribute error]
expected: FAIL
[FileReader interface: attribute onloadstart]
expected: FAIL
[FileReader interface: attribute onprogress]
expected: FAIL
[FileReader interface: attribute onload]
expected: FAIL
[FileReader interface: attribute onabort]
expected: FAIL
[FileReader interface: attribute onerror]
expected: FAIL
[FileReader interface: attribute onloadend]
expected: FAIL
[FileReader must be primary interface of new FileReader()]
expected: FAIL
[Stringification of new FileReader()]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "readAsArrayBuffer" with the proper type (0)]
expected: FAIL
[FileReader interface: calling readAsArrayBuffer(Blob) on new FileReader() with too few arguments must throw TypeError]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "readAsText" with the proper type (1)]
expected: FAIL
[FileReader interface: calling readAsText(Blob,DOMString) on new FileReader() with too few arguments must throw TypeError]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "readAsDataURL" with the proper type (2)]
expected: FAIL
[FileReader interface: calling readAsDataURL(Blob) on new FileReader() with too few arguments must throw TypeError]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "abort" with the proper type (3)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "EMPTY" with the proper type (4)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "LOADING" with the proper type (5)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "DONE" with the proper type (6)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "readyState" with the proper type (7)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "result" with the proper type (8)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "error" with the proper type (9)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "onloadstart" with the proper type (10)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "onprogress" with the proper type (11)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "onload" with the proper type (12)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "onabort" with the proper type (13)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "onerror" with the proper type (14)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "onloadend" with the proper type (15)]
expected: FAIL
[FileReaderSync interface: existence and properties of interface object]
expected: FAIL
@ -246,3 +117,12 @@
[FileReaderSync interface: operation readAsDataURL(Blob)]
expected: FAIL
[FileReader interface: operation readAsArrayBuffer(Blob)]
expected: FAIL
[FileReader interface: new FileReader() must inherit property "readAsArrayBuffer" with the proper type (0)]
expected: FAIL
[FileReader interface: calling readAsArrayBuffer(Blob) on new FileReader() with too few arguments must throw TypeError]
expected: FAIL

View file

@ -1,20 +0,0 @@
[FileReader-event-handler-attributes.html]
type: testharness
[FileReader.onloadstart: initial value]
expected: FAIL
[FileReader.onprogress: initial value]
expected: FAIL
[FileReader.onload: initial value]
expected: FAIL
[FileReader.onabort: initial value]
expected: FAIL
[FileReader.onerror: initial value]
expected: FAIL
[FileReader.onloadend: initial value]
expected: FAIL

View file

@ -1,9 +1,6 @@
[FileReader-multiple-reads.html]
type: testharness
[test FileReader InvalidStateError exception for readAsText]
expected: FAIL
[test FileReader InvalidStateError exception for readAsDataURL]
[test FileReader no InvalidStateError exception in onloadstart event for readAsArrayBuffer]
expected: FAIL
[test FileReader InvalidStateError exception for readAsArrayBuffer]
@ -12,6 +9,3 @@
[test FileReader InvalidStateError exception in onloadstart event for readAsArrayBuffer]
expected: FAIL
[test FileReader no InvalidStateError exception in onloadstart event for readAsArrayBuffer]
expected: FAIL

View file

@ -1,8 +0,0 @@
[filereader_abort.html]
type: testharness
[Aborting before read]
expected: FAIL
[Aborting after read]
expected: FAIL

View file

@ -1,5 +0,0 @@
[filereader_error.html]
type: testharness
[FileAPI Test: filereader_error]
expected: FAIL

View file

@ -1,5 +0,0 @@
[filereader_readAsDataURL.html]
type: testharness
[FileAPI Test: filereader_readAsDataURL]
expected: FAIL

View file

@ -1,8 +0,0 @@
[filereader_readAsText.html]
type: testharness
[readAsText should correctly read UTF-8.]
expected: FAIL
[readAsText should correctly read UTF-16.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[filereader_readystate.html]
type: testharness
[FileAPI Test: filereader_readystate]
expected: FAIL

View file

@ -1,11 +1,5 @@
[filereader_result.html]
type: testharness
[readAsText]
expected: FAIL
[readAsDataURL]
expected: FAIL
[readAsArrayBuffer]
expected: FAIL

View file

@ -99,6 +99,7 @@ var interfaceNamesInGlobalScope = [
"Event",
"EventTarget",
"File",
"FileReader",
"FormData",
"HTMLAnchorElement",
"HTMLAppletElement",