Auto merge of #6803 - farodin91:blob, r=Ms2ger

Adding for support Blob.{close,isClose} #6723



<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6803)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-07-29 04:41:19 -06:00
commit 96b0f96ce2
7 changed files with 67 additions and 61 deletions

View file

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

View file

@ -9,18 +9,6 @@
[URL interface: operation revokeObjectURL(DOMString)]
expected: FAIL
[Blob interface: attribute isClosed]
expected: FAIL
[Blob interface: operation close()]
expected: FAIL
[Blob interface: new Blob(["TEST"\]) must inherit property "isClosed" with the proper type (2)]
expected: FAIL
[Blob interface: new Blob(["TEST"\]) must inherit property "close" with the proper type (4)]
expected: FAIL
[File interface: existence and properties of interface object]
expected: FAIL

View file

@ -9,18 +9,6 @@
[URL interface: operation revokeObjectURL(DOMString)]
expected: FAIL
[Blob interface: attribute isClosed]
expected: FAIL
[Blob interface: operation close()]
expected: FAIL
[Blob interface: new Blob(["TEST"\]) must inherit property "isClosed" with the proper type (2)]
expected: FAIL
[Blob interface: new Blob(["TEST"\]) must inherit property "close" with the proper type (4)]
expected: FAIL
[File interface: existence and properties of interface object]
expected: FAIL

View file

@ -11,17 +11,27 @@ test(function() {
var blob = new Blob(["TEST"]);
var sliced = blob.slice();
blob.close();
test_blob(function() {
return blob;
}, {
expected: "",
type: "",
desc: "Blob should be empty."
});
async_test(function(t) {
var reader = new FileReader();
reader.onload = t.step_func(function(evt) {
assert_unreached("Should not dispatch the load event");
});
reader.onerror = t.step_func(function(e) {
assert_equals(reader.result, null);
assert_equals(reader.error.code, DOMException.INVALID_STATE_ERR);
t.done();
});
reader.readAsText(blob, "UTF-8");
}, "Closed Blob");
test_blob(function() {
return sliced;
}, {
expected: "PASS",
expected: "TEST",
type: "",
desc: "Slice should still have the data."
});