mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
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:
commit
e6f661c984
8 changed files with 12 additions and 38 deletions
|
@ -27,7 +27,7 @@ use js::jsapi::Heap;
|
|||
use js::jsapi::JSAutoCompartment;
|
||||
use js::jsapi::JSContext;
|
||||
use js::jsval::{self, JSVal};
|
||||
use js::typedarray::Uint8Array;
|
||||
use js::typedarray::ArrayBuffer;
|
||||
use rustc_serialize::base64::{CharacterSet, Config, Newline, ToBase64};
|
||||
use script_thread::RunnableWrapper;
|
||||
use servo_atoms::Atom;
|
||||
|
@ -269,7 +269,7 @@ impl FileReader {
|
|||
cx: *mut JSContext, _: ReadMetaData, bytes: &[u8]) {
|
||||
unsafe {
|
||||
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()));
|
||||
|
||||
|
|
|
@ -3,24 +3,6 @@
|
|||
[URL interface: operation createFor(Blob)]
|
||||
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)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -2,19 +2,25 @@
|
|||
type: testharness
|
||||
[Blob Determing Encoding with encoding argument]
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/10911
|
||||
|
||||
[Blob Determing Encoding with type attribute]
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/10911
|
||||
|
||||
[Blob Determing Encoding with UTF-8 BOM]
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/10911
|
||||
|
||||
[Blob Determing Encoding without anything implying charset.]
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/10911
|
||||
|
||||
[Blob Determing Encoding with UTF-16BE BOM]
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/10911
|
||||
|
||||
[Blob Determing Encoding with UTF-16LE BOM]
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/10911
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[FileReader-multiple-reads.html]
|
||||
type: testharness
|
||||
[test FileReader no InvalidStateError exception in onloadstart event for readAsArrayBuffer]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[filereader_readAsArrayBuffer.html]
|
||||
type: testharness
|
||||
[FileAPI Test: filereader_readAsArrayBuffer]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
[filereader_result.html]
|
||||
type: testharness
|
||||
[readAsArrayBuffer]
|
||||
expected: FAIL
|
||||
|
|
@ -2,4 +2,5 @@
|
|||
type: testharness
|
||||
[Check if the Blob URI starts with 'blob' using createFor()]
|
||||
expected: FAIL
|
||||
bug: https://github.com/servo/servo/issues/15112
|
||||
|
||||
|
|
|
@ -62,12 +62,12 @@ async_test(function() {
|
|||
var blob_2 = new Blob(['TEST000000002'])
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = this.step_func_done(function() {
|
||||
assert_equals(reader.readyState, FileReader.LOADING,
|
||||
"readyState must be LOADING")
|
||||
assert_equals(reader.readyState, FileReader.DONE,
|
||||
"readyState must be DONE")
|
||||
reader.readAsArrayBuffer(blob_2)
|
||||
assert_equals(reader.readyState, FileReader.LOADING, "readyState Must be LOADING")
|
||||
});
|
||||
reader.readAsArrayBuffer(blob_1)
|
||||
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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue