mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1611230 [wpt PR 21386] - Remove assert_throws use in FileAPI tests., a=testonly
Automatic update from web-platform-tests Remove assert_throws use in FileAPI tests. (#21386) -- wpt-commits: a9c0cab763ec38a6b8f10a106f87d944d5588c02 wpt-pr: 21386
This commit is contained in:
parent
7a9e5b19de
commit
a208bd2617
@ -42,7 +42,7 @@ function readBlobAsPromise(blob) {
|
||||
|
||||
test(t => {
|
||||
const test_error = {name: 'test'};
|
||||
assert_throws(
|
||||
assert_throws_exactly(
|
||||
test_error,
|
||||
() => new Blob([], { get endings() { throw test_error; }}),
|
||||
'Blob constructor should propagate exceptions from "endings" property');
|
||||
|
@ -124,7 +124,7 @@ test(function() {
|
||||
[Symbol.iterator]: Array.prototype[Symbol.iterator],
|
||||
get length() { throw test_error; }
|
||||
};
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
new Blob(obj);
|
||||
});
|
||||
}, "The length getter should be invoked and any exceptions should be propagated.");
|
||||
@ -137,13 +137,13 @@ test(function() {
|
||||
Object.defineProperty(list, "length", {
|
||||
get: function() { throw test_error; }
|
||||
});
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
new Blob(list);
|
||||
});
|
||||
}, "A platform object that supports indexed properties should be treated as a sequence for the blobParts argument (overwritten 'length'.)");
|
||||
|
||||
test(function() {
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
var obj = {
|
||||
[Symbol.iterator]: Array.prototype[Symbol.iterator],
|
||||
length: {
|
||||
@ -153,7 +153,7 @@ test(function() {
|
||||
};
|
||||
new Blob(obj);
|
||||
});
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
var obj = {
|
||||
[Symbol.iterator]: Array.prototype[Symbol.iterator],
|
||||
length: { valueOf: function() { throw test_error; } }
|
||||
@ -196,7 +196,7 @@ test(function() {
|
||||
assert_unreached("Should not call the getter for 2 if the getter for 1 threw.");
|
||||
}
|
||||
};
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
new Blob(obj);
|
||||
});
|
||||
assert_array_equals(received, [
|
||||
@ -214,13 +214,13 @@ test(function() {
|
||||
// XXX should add tests edge cases of ToLength(length)
|
||||
|
||||
test(function() {
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
new Blob([{ toString: function() { throw test_error; } }]);
|
||||
}, "Throwing toString");
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
new Blob([{ toString: undefined, valueOf: function() { throw test_error; } }]);
|
||||
}, "Throwing valueOf");
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
new Blob([{
|
||||
toString: function() { throw test_error; },
|
||||
valueOf: function() { assert_unreached("Should not call valueOf if toString is present."); }
|
||||
@ -423,7 +423,7 @@ test(function() {
|
||||
}, "options properties should be accessed in lexicographic order.");
|
||||
|
||||
test(function() {
|
||||
assert_throws(test_error, function() {
|
||||
assert_throws_exactly(test_error, function() {
|
||||
new Blob(
|
||||
[{ toString: function() { throw test_error } }],
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ function readBlobAsPromise(blob) {
|
||||
|
||||
test(t => {
|
||||
const test_error = {name: 'test'};
|
||||
assert_throws(
|
||||
assert_throws_exactly(
|
||||
test_error,
|
||||
() => new File([], "name", { get endings() { throw test_error; }}),
|
||||
'File constructor should propagate exceptions from "endings" property');
|
||||
|
Loading…
Reference in New Issue
Block a user