mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Adding for support Blob.{close,isClose} #6723
This commit is contained in:
parent
fff104bb41
commit
20f99e92d8
7 changed files with 67 additions and 61 deletions
|
@ -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."
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue