Auto merge of #15117 - servo:fileapi, r=nox

Fix and annotate some FileAPI test failures.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15117)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-01-20 08:03:41 -08:00 committed by GitHub
commit e6f661c984
8 changed files with 12 additions and 38 deletions

View file

@ -27,7 +27,7 @@ use js::jsapi::Heap;
use js::jsapi::JSAutoCompartment; use js::jsapi::JSAutoCompartment;
use js::jsapi::JSContext; use js::jsapi::JSContext;
use js::jsval::{self, JSVal}; use js::jsval::{self, JSVal};
use js::typedarray::Uint8Array; use js::typedarray::ArrayBuffer;
use rustc_serialize::base64::{CharacterSet, Config, Newline, ToBase64}; use rustc_serialize::base64::{CharacterSet, Config, Newline, ToBase64};
use script_thread::RunnableWrapper; use script_thread::RunnableWrapper;
use servo_atoms::Atom; use servo_atoms::Atom;
@ -269,7 +269,7 @@ impl FileReader {
cx: *mut JSContext, _: ReadMetaData, bytes: &[u8]) { cx: *mut JSContext, _: ReadMetaData, bytes: &[u8]) {
unsafe { unsafe {
rooted!(in(cx) let mut array_buffer = ptr::null_mut()); rooted!(in(cx) let mut array_buffer = ptr::null_mut());
assert!(Uint8Array::create(cx, bytes.len() as u32, Some(bytes), array_buffer.handle_mut()).is_ok()); assert!(ArrayBuffer::create(cx, bytes.len() as u32, Some(bytes), array_buffer.handle_mut()).is_ok());
*result.borrow_mut() = Some(FileReaderResult::ArrayBuffer(Heap::default())); *result.borrow_mut() = Some(FileReaderResult::ArrayBuffer(Heap::default()));

View file

@ -3,24 +3,6 @@
[URL interface: operation createFor(Blob)] [URL interface: operation createFor(Blob)]
expected: FAIL expected: FAIL
[FileReaderSync interface object length]
expected: FAIL
[FileReaderSync interface: existence and properties of interface prototype object]
expected: FAIL
[FileReaderSync interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[FileReaderSync interface: operation readAsArrayBuffer(Blob)]
expected: FAIL
[FileReaderSync interface: operation readAsText(Blob,DOMString)]
expected: FAIL
[FileReaderSync interface: operation readAsDataURL(Blob)]
expected: FAIL
[FileReader interface: operation readAsBinaryString(Blob)] [FileReader interface: operation readAsBinaryString(Blob)]
expected: FAIL expected: FAIL

View file

@ -2,19 +2,25 @@
type: testharness type: testharness
[Blob Determing Encoding with encoding argument] [Blob Determing Encoding with encoding argument]
expected: FAIL expected: FAIL
bug: https://github.com/servo/servo/issues/10911
[Blob Determing Encoding with type attribute] [Blob Determing Encoding with type attribute]
expected: FAIL expected: FAIL
bug: https://github.com/servo/servo/issues/10911
[Blob Determing Encoding with UTF-8 BOM] [Blob Determing Encoding with UTF-8 BOM]
expected: FAIL expected: FAIL
bug: https://github.com/servo/servo/issues/10911
[Blob Determing Encoding without anything implying charset.] [Blob Determing Encoding without anything implying charset.]
expected: FAIL expected: FAIL
bug: https://github.com/servo/servo/issues/10911
[Blob Determing Encoding with UTF-16BE BOM] [Blob Determing Encoding with UTF-16BE BOM]
expected: FAIL expected: FAIL
bug: https://github.com/servo/servo/issues/10911
[Blob Determing Encoding with UTF-16LE BOM] [Blob Determing Encoding with UTF-16LE BOM]
expected: FAIL expected: FAIL
bug: https://github.com/servo/servo/issues/10911

View file

@ -1,5 +0,0 @@
[FileReader-multiple-reads.html]
type: testharness
[test FileReader no InvalidStateError exception in onloadstart event for readAsArrayBuffer]
expected: FAIL

View file

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

View file

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

View file

@ -2,4 +2,5 @@
type: testharness type: testharness
[Check if the Blob URI starts with 'blob' using createFor()] [Check if the Blob URI starts with 'blob' using createFor()]
expected: FAIL expected: FAIL
bug: https://github.com/servo/servo/issues/15112

View file

@ -62,12 +62,12 @@ async_test(function() {
var blob_2 = new Blob(['TEST000000002']) var blob_2 = new Blob(['TEST000000002'])
var reader = new FileReader(); var reader = new FileReader();
reader.onloadend = this.step_func_done(function() { reader.onloadend = this.step_func_done(function() {
assert_equals(reader.readyState, FileReader.LOADING, assert_equals(reader.readyState, FileReader.DONE,
"readyState must be LOADING") "readyState must be DONE")
reader.readAsArrayBuffer(blob_2) reader.readAsArrayBuffer(blob_2)
assert_equals(reader.readyState, FileReader.LOADING, "readyState Must be LOADING") assert_equals(reader.readyState, FileReader.LOADING, "readyState Must be LOADING")
}); });
reader.readAsArrayBuffer(blob_1) reader.readAsArrayBuffer(blob_1)
assert_equals(reader.readyState, FileReader.LOADING, "readyState Must be LOADING") assert_equals(reader.readyState, FileReader.LOADING, "readyState Must be LOADING")
}, 'test FileReader no InvalidStateError exception in onloadstart event for readAsArrayBuffer'); }, 'test FileReader no InvalidStateError exception in loadend event handler for readAsArrayBuffer');
</script> </script>