mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1610938 [wpt PR 21354] - Replace some "assert_throws(new FooError(), stuff)" calls with assert_throws_js, a=testonly
Automatic update from web-platform-tests Replace some "assert_throws(new FooError(), stuff)" calls with assert_throws_js. (#21354) This diff was generated by running: find . -type f -print0 | xargs -0 perl -pi -e 'BEGIN { $/ = undef; } s/assert_throws\(([ \n]*)new ([A-Za-z]*Error) *\(\) *(, *.)/assert_throws_js(\1\2\3/gs' and then: 1) Manually adjusting fullscreen/rendering/fullscreen-pseudo-class-support.html to test for the right sort of exceptions ("SyntaxError" DOMException, not a JS SyntaxError). 2) Manually adjusting performance-timeline/po-observe-type.any.js to test for the right sort of exceptions ("SyntaxError" DOMException, not a JS SyntaxError). 3) Manually adjusting performance-timeline/po-observe.any.js to test for the right sort of exceptions ("SyntaxError" DOMException, not a JS SyntaxError). 4) Manually adjusting user-timing/mark_exceptions.html to test for the right sort of exceptions ("SyntaxError" DOMException, not a JS SyntaxError). 5) Manually adjusting user-timing/measure_syntax_err.any.js to test for the right sort of exceptions ("SyntaxError" DOMException, not a JS SyntaxError). 6) Manually adjusting domxpath/lexical-structure.html to test for a "SyntaxError" DOMException, since that's what all browsers throw and there is no clear spec for this. 7) Manually adjusting workers/constructors/Worker/Worker-constructor.html to test for the right sort of exceptions ("SyntaxError" DOMException, not a JS SyntaxError). 8) Backing out the changes to resources/idlharness.js because some tests pass objects from a different window to it, and we end up with the wrong TypeError constructor in those cases. This does affect indentation poorly in cases when the first arg was on the same line as the assert_throws, there was a newline after the ',' after the first arg, and the following args were lined up with the first arg. Fixing that, especially when there are multiple lines after the first arg, is not trivial with a regexp. Co-authored-by: Boris Zbarsky <bzbarsky@mit.edu> Co-authored-by: Stephen McGruer <smcgruer@chromium.org> -- wpt-commits: 2c5c3c4c27d27a419c1fdba3e9879c2d22037074 wpt-pr: 21354
This commit is contained in:
parent
36da211367
commit
c67612824c
@ -19,121 +19,121 @@
|
|||||||
var t = async_test("Missing arguments cause TypeError");
|
var t = async_test("Missing arguments cause TypeError");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.scale(); });
|
assert_throws_js(TypeError, function() { ctx.scale(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.scale(1); });
|
assert_throws_js(TypeError, function() { ctx.scale(1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.rotate(); });
|
assert_throws_js(TypeError, function() { ctx.rotate(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.translate(); });
|
assert_throws_js(TypeError, function() { ctx.translate(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.translate(0); });
|
assert_throws_js(TypeError, function() { ctx.translate(0); });
|
||||||
if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported)
|
if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported)
|
||||||
assert_throws(new TypeError(), function() { ctx.transform(); });
|
assert_throws_js(TypeError, function() { ctx.transform(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.transform(1); });
|
assert_throws_js(TypeError, function() { ctx.transform(1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.transform(1, 0); });
|
assert_throws_js(TypeError, function() { ctx.transform(1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.transform(1, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.transform(1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.transform(1, 0, 0, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0, 1, 0); });
|
||||||
}
|
}
|
||||||
if (ctx.setTransform) {
|
if (ctx.setTransform) {
|
||||||
assert_throws(new TypeError(), function() { ctx.setTransform(1); });
|
assert_throws_js(TypeError, function() { ctx.setTransform(1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.setTransform(1, 0); });
|
assert_throws_js(TypeError, function() { ctx.setTransform(1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.setTransform(1, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.setTransform(1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.setTransform(1, 0, 0, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0, 1, 0); });
|
||||||
}
|
}
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createPattern(canvas); });
|
assert_throws_js(TypeError, function() { ctx.createPattern(canvas); });
|
||||||
assert_throws(new TypeError(), function() { ctx.clearRect(); });
|
assert_throws_js(TypeError, function() { ctx.clearRect(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.clearRect(0); });
|
assert_throws_js(TypeError, function() { ctx.clearRect(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.clearRect(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.clearRect(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.clearRect(0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.clearRect(0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.fillRect(); });
|
assert_throws_js(TypeError, function() { ctx.fillRect(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.fillRect(0); });
|
assert_throws_js(TypeError, function() { ctx.fillRect(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.fillRect(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.fillRect(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.fillRect(0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.fillRect(0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.strokeRect(); });
|
assert_throws_js(TypeError, function() { ctx.strokeRect(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.strokeRect(0); });
|
assert_throws_js(TypeError, function() { ctx.strokeRect(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.strokeRect(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.strokeRect(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.strokeRect(0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.strokeRect(0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.moveTo(); });
|
assert_throws_js(TypeError, function() { ctx.moveTo(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.moveTo(0); });
|
assert_throws_js(TypeError, function() { ctx.moveTo(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.lineTo(); });
|
assert_throws_js(TypeError, function() { ctx.lineTo(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.lineTo(0); });
|
assert_throws_js(TypeError, function() { ctx.lineTo(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.quadraticCurveTo(); });
|
assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.quadraticCurveTo(0); });
|
assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.quadraticCurveTo(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.quadraticCurveTo(0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.bezierCurveTo(); });
|
assert_throws_js(TypeError, function() { ctx.bezierCurveTo(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0); });
|
assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0, 0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.bezierCurveTo(0, 0, 0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arcTo(); });
|
assert_throws_js(TypeError, function() { ctx.arcTo(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arcTo(0); });
|
assert_throws_js(TypeError, function() { ctx.arcTo(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arcTo(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.arcTo(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arcTo(0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.arcTo(0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arcTo(0, 0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.arcTo(0, 0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.rect(); });
|
assert_throws_js(TypeError, function() { ctx.rect(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.rect(0); });
|
assert_throws_js(TypeError, function() { ctx.rect(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.rect(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.rect(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.rect(0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.rect(0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arc(); });
|
assert_throws_js(TypeError, function() { ctx.arc(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arc(0); });
|
assert_throws_js(TypeError, function() { ctx.arc(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arc(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.arc(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arc(0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.arc(0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.arc(0, 0, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.arc(0, 0, 1, 0); });
|
||||||
// (6th argument to arc is optional)
|
// (6th argument to arc is optional)
|
||||||
if (ctx.isPointInPath) {
|
if (ctx.isPointInPath) {
|
||||||
assert_throws(new TypeError(), function() { ctx.isPointInPath(); });
|
assert_throws_js(TypeError, function() { ctx.isPointInPath(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.isPointInPath(0); });
|
assert_throws_js(TypeError, function() { ctx.isPointInPath(0); });
|
||||||
}
|
}
|
||||||
if (ctx.drawFocusRing) {
|
if (ctx.drawFocusRing) {
|
||||||
assert_throws(new TypeError(), function() { ctx.drawFocusRing(); });
|
assert_throws_js(TypeError, function() { ctx.drawFocusRing(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.drawFocusRing(canvas); });
|
assert_throws_js(TypeError, function() { ctx.drawFocusRing(canvas); });
|
||||||
assert_throws(new TypeError(), function() { ctx.drawFocusRing(canvas, 0); });
|
assert_throws_js(TypeError, function() { ctx.drawFocusRing(canvas, 0); });
|
||||||
}
|
}
|
||||||
if (ctx.fillText) {
|
if (ctx.fillText) {
|
||||||
assert_throws(new TypeError(), function() { ctx.fillText(); });
|
assert_throws_js(TypeError, function() { ctx.fillText(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.fillText('test'); });
|
assert_throws_js(TypeError, function() { ctx.fillText('test'); });
|
||||||
assert_throws(new TypeError(), function() { ctx.fillText('test', 0); });
|
assert_throws_js(TypeError, function() { ctx.fillText('test', 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.strokeText(); });
|
assert_throws_js(TypeError, function() { ctx.strokeText(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.strokeText('test'); });
|
assert_throws_js(TypeError, function() { ctx.strokeText('test'); });
|
||||||
assert_throws(new TypeError(), function() { ctx.strokeText('test', 0); });
|
assert_throws_js(TypeError, function() { ctx.strokeText('test', 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.measureText(); });
|
assert_throws_js(TypeError, function() { ctx.measureText(); });
|
||||||
}
|
}
|
||||||
assert_throws(new TypeError(), function() { ctx.drawImage(); });
|
assert_throws_js(TypeError, function() { ctx.drawImage(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.drawImage(canvas); });
|
assert_throws_js(TypeError, function() { ctx.drawImage(canvas); });
|
||||||
assert_throws(new TypeError(), function() { ctx.drawImage(canvas, 0); });
|
assert_throws_js(TypeError, function() { ctx.drawImage(canvas, 0); });
|
||||||
// TODO: n >= 3 args on drawImage could be either a valid overload,
|
// TODO: n >= 3 args on drawImage could be either a valid overload,
|
||||||
// or too few for another overload, or too many for another
|
// or too few for another overload, or too many for another
|
||||||
// overload - what should happen?
|
// overload - what should happen?
|
||||||
if (ctx.createImageData) {
|
if (ctx.createImageData) {
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(1); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(1); });
|
||||||
}
|
}
|
||||||
if (ctx.getImageData) {
|
if (ctx.getImageData) {
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(0); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(0, 0); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(0, 0, 1); });
|
||||||
}
|
}
|
||||||
if (ctx.putImageData) {
|
if (ctx.putImageData) {
|
||||||
var imgdata = ctx.getImageData(0, 0, 1, 1);
|
var imgdata = ctx.getImageData(0, 0, 1, 1);
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 0); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 0); });
|
||||||
}
|
}
|
||||||
var g = ctx.createLinearGradient(0, 0, 0, 0);
|
var g = ctx.createLinearGradient(0, 0, 0, 0);
|
||||||
assert_throws(new TypeError(), function() { g.addColorStop(); });
|
assert_throws_js(TypeError, function() { g.addColorStop(); });
|
||||||
assert_throws(new TypeError(), function() { g.addColorStop(0); });
|
assert_throws_js(TypeError, function() { g.addColorStop(0); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
var t = async_test("");
|
var t = async_test("");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.drawImage(null, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.drawImage(null, 0, 0); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,10 +19,10 @@
|
|||||||
var t = async_test("Incorrect image types in drawImage do not match any defined overloads, so WebIDL throws a TypeError");
|
var t = async_test("Incorrect image types in drawImage do not match any defined overloads, so WebIDL throws a TypeError");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.drawImage(undefined, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.drawImage(undefined, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.drawImage(0, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.drawImage(0, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.drawImage("", 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.drawImage("", 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.drawImage(document.createElement('p'), 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.drawImage(document.createElement('p'), 0, 0); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,29 +19,29 @@
|
|||||||
var t = async_test("createLinearGradient() throws TypeError if arguments are not finite");
|
var t = async_test("createLinearGradient() throws TypeError if arguments are not finite");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, 1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(-Infinity, 0, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(-Infinity, 0, 1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(NaN, 0, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(NaN, 0, 1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, 1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, -Infinity, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, -Infinity, 1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, NaN, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, NaN, 1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, Infinity, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, Infinity, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, -Infinity, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, -Infinity, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, NaN, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, NaN, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, -Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, -Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, NaN); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, NaN); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, 1, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, 1, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, Infinity, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, Infinity, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, 1, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, 1, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, Infinity, 0); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, Infinity, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, 1, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, 1, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, Infinity, Infinity); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -22,9 +22,9 @@ _addTest(function(canvas, ctx) {
|
|||||||
var g = ctx.createLinearGradient(0, 0, 100, 0);
|
var g = ctx.createLinearGradient(0, 0, 100, 0);
|
||||||
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(-1, '#000'); });
|
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(-1, '#000'); });
|
||||||
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(2, '#000'); });
|
assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(2, '#000'); });
|
||||||
assert_throws(new TypeError(), function() { g.addColorStop(Infinity, '#000'); });
|
assert_throws_js(TypeError, function() { g.addColorStop(Infinity, '#000'); });
|
||||||
assert_throws(new TypeError(), function() { g.addColorStop(-Infinity, '#000'); });
|
assert_throws_js(TypeError, function() { g.addColorStop(-Infinity, '#000'); });
|
||||||
assert_throws(new TypeError(), function() { g.addColorStop(NaN, '#000'); });
|
assert_throws_js(TypeError, function() { g.addColorStop(NaN, '#000'); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,81 +19,81 @@
|
|||||||
var t = async_test("createRadialGradient() throws TypeError if arguments are not finite");
|
var t = async_test("createRadialGradient() throws TypeError if arguments are not finite");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
var t = async_test("");
|
var t = async_test("");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.createPattern(null, 'repeat'); });
|
assert_throws_js(TypeError, function() { ctx.createPattern(null, 'repeat'); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
var t = async_test("");
|
var t = async_test("");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.createPattern('../images/red.png', 'repeat'); });
|
assert_throws_js(TypeError, function() { ctx.createPattern('../images/red.png', 'repeat'); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
var t = async_test("");
|
var t = async_test("");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.createPattern(undefined, 'repeat'); });
|
assert_throws_js(TypeError, function() { ctx.createPattern(undefined, 'repeat'); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -20,9 +20,9 @@ var t = async_test("createImageData(imgdata) should throw when called with the w
|
|||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
var imgdata = ctx.createImageData(1, 1);
|
var imgdata = ctx.createImageData(1, 1);
|
||||||
assert_throws(new TypeError(), function() { CanvasRenderingContext2D.prototype.createImageData.call(null, imgdata); });
|
assert_throws_js(TypeError, function() { CanvasRenderingContext2D.prototype.createImageData.call(null, imgdata); });
|
||||||
assert_throws(new TypeError(), function() { CanvasRenderingContext2D.prototype.createImageData.call(undefined, imgdata); });
|
assert_throws_js(TypeError, function() { CanvasRenderingContext2D.prototype.createImageData.call(undefined, imgdata); });
|
||||||
assert_throws(new TypeError(), function() { CanvasRenderingContext2D.prototype.createImageData.call({}, imgdata); });
|
assert_throws_js(TypeError, function() { CanvasRenderingContext2D.prototype.createImageData.call({}, imgdata); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
var t = async_test("createImageData(null) throws TypeError");
|
var t = async_test("createImageData(null) throws TypeError");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(null); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(null); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,23 +19,23 @@
|
|||||||
var t = async_test("createImageData() throws TypeError if arguments are not finite");
|
var t = async_test("createImageData() throws TypeError if arguments are not finite");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(-Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(-Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(NaN, 10); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(NaN, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(10, -Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(10, -Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(10, NaN); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(10, NaN); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(Infinity, Infinity); });
|
||||||
var posinfobj = { valueOf: function() { return Infinity; } },
|
var posinfobj = { valueOf: function() { return Infinity; } },
|
||||||
neginfobj = { valueOf: function() { return -Infinity; } },
|
neginfobj = { valueOf: function() { return -Infinity; } },
|
||||||
nanobj = { valueOf: function() { return -Infinity; } };
|
nanobj = { valueOf: function() { return -Infinity; } };
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(posinfobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(posinfobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(neginfobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(neginfobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(nanobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(nanobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(10, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(10, posinfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(10, neginfobj); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(10, neginfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(10, nanobj); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(10, nanobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.createImageData(posinfobj, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.createImageData(posinfobj, posinfobj); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
var t = async_test("createImageData(sw, sh) should throw when called with the wrong |this|");
|
var t = async_test("createImageData(sw, sh) should throw when called with the wrong |this|");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { CanvasRenderingContext2D.prototype.createImageData.call(null, 1, 1); });
|
assert_throws_js(TypeError, function() { CanvasRenderingContext2D.prototype.createImageData.call(null, 1, 1); });
|
||||||
assert_throws(new TypeError(), function() { CanvasRenderingContext2D.prototype.createImageData.call(undefined, 1, 1); });
|
assert_throws_js(TypeError, function() { CanvasRenderingContext2D.prototype.createImageData.call(undefined, 1, 1); });
|
||||||
assert_throws(new TypeError(), function() { CanvasRenderingContext2D.prototype.createImageData.call({}, 1, 1); });
|
assert_throws_js(TypeError, function() { CanvasRenderingContext2D.prototype.createImageData.call({}, 1, 1); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,55 +19,55 @@
|
|||||||
var t = async_test("getImageData() throws TypeError if arguments are not finite");
|
var t = async_test("getImageData() throws TypeError if arguments are not finite");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(Infinity, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(-Infinity, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(-Infinity, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(NaN, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(NaN, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, -Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, -Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, NaN, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, NaN, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, -Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, -Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, NaN, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, NaN, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, 10, -Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, -Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, 10, NaN); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, NaN); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(Infinity, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(Infinity, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(Infinity, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(Infinity, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(Infinity, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, 10, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(Infinity, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, Infinity, Infinity); });
|
||||||
var posinfobj = { valueOf: function() { return Infinity; } },
|
var posinfobj = { valueOf: function() { return Infinity; } },
|
||||||
neginfobj = { valueOf: function() { return -Infinity; } },
|
neginfobj = { valueOf: function() { return -Infinity; } },
|
||||||
nanobj = { valueOf: function() { return -Infinity; } };
|
nanobj = { valueOf: function() { return -Infinity; } };
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(posinfobj, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(neginfobj, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(neginfobj, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(nanobj, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(nanobj, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, posinfobj, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, posinfobj, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, neginfobj, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, neginfobj, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, nanobj, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, nanobj, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, posinfobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, posinfobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, neginfobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, neginfobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, nanobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, nanobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, 10, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, posinfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, 10, neginfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, neginfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, 10, nanobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, nanobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(posinfobj, posinfobj, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, posinfobj, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(posinfobj, posinfobj, posinfobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, posinfobj, posinfobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(posinfobj, posinfobj, posinfobj, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, posinfobj, posinfobj, posinfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(posinfobj, posinfobj, 10, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, posinfobj, 10, posinfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(posinfobj, 10, posinfobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, 10, posinfobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(posinfobj, 10, posinfobj, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, 10, posinfobj, posinfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(posinfobj, 10, 10, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, 10, 10, posinfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, posinfobj, posinfobj, 10); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, posinfobj, posinfobj, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, posinfobj, posinfobj, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, posinfobj, posinfobj, posinfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, posinfobj, 10, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, posinfobj, 10, posinfobj); });
|
||||||
assert_throws(new TypeError(), function() { ctx.getImageData(10, 10, posinfobj, posinfobj); });
|
assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, posinfobj, posinfobj); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -25,8 +25,8 @@ assert_throws("INVALID_STATE_ERR", function() { new ImageData(new Uint8ClampedAr
|
|||||||
assert_throws("INVALID_STATE_ERR", function() { new ImageData(new Uint8ClampedArray(3), 1); });
|
assert_throws("INVALID_STATE_ERR", function() { new ImageData(new Uint8ClampedArray(3), 1); });
|
||||||
assert_throws("INDEX_SIZE_ERR", function() { new ImageData(new Uint8ClampedArray(4), 0); });
|
assert_throws("INDEX_SIZE_ERR", function() { new ImageData(new Uint8ClampedArray(4), 0); });
|
||||||
assert_throws("INDEX_SIZE_ERR", function() { new ImageData(new Uint8ClampedArray(4), 1, 2); });
|
assert_throws("INDEX_SIZE_ERR", function() { new ImageData(new Uint8ClampedArray(4), 1, 2); });
|
||||||
assert_throws(new TypeError(), function() { new ImageData(new Uint8Array(8), 1, 2); });
|
assert_throws_js(TypeError, function() { new ImageData(new Uint8Array(8), 1, 2); });
|
||||||
assert_throws(new TypeError(), function() { new ImageData(new Int8Array(8), 1, 2); });
|
assert_throws_js(TypeError, function() { new ImageData(new Int8Array(8), 1, 2); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -20,88 +20,88 @@ var t = async_test("putImageData() throws TypeError if arguments are not finite"
|
|||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
var imgdata = ctx.getImageData(0, 0, 10, 10);
|
var imgdata = ctx.getImageData(0, 0, 10, 10);
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, -Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, -Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, NaN, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, NaN, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, -Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, -Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, NaN); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, NaN); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
var t = async_test("putImageData() with null imagedata throws TypeError");
|
var t = async_test("putImageData() with null imagedata throws TypeError");
|
||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(null, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(null, 0, 0); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -20,9 +20,9 @@ var t = async_test("putImageData() does not accept non-ImageData objects");
|
|||||||
_addTest(function(canvas, ctx) {
|
_addTest(function(canvas, ctx) {
|
||||||
|
|
||||||
var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] };
|
var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] };
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(imgdata, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData("cheese", 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.putImageData("cheese", 0, 0); });
|
||||||
assert_throws(new TypeError(), function() { ctx.putImageData(42, 0, 0); });
|
assert_throws_js(TypeError, function() { ctx.putImageData(42, 0, 0); });
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -233,7 +233,7 @@ def genTestUtils(TESTOUTPUTDIR, IMAGEOUTPUTDIR, TEMPLATEFILE, NAME2DIRFILE, ISOF
|
|||||||
code)
|
code)
|
||||||
|
|
||||||
code = re.sub(r'@assert throws (\S+Error) (.*);',
|
code = re.sub(r'@assert throws (\S+Error) (.*);',
|
||||||
r'assert_throws(new \1(), function() { \2; });',
|
r'assert_throws_js(\1, function() { \2; });',
|
||||||
code)
|
code)
|
||||||
|
|
||||||
code = re.sub(r'@assert (.*) === (.*);',
|
code = re.sub(r'@assert (.*) === (.*);',
|
||||||
|
@ -36,7 +36,7 @@ function readBlobAsPromise(blob) {
|
|||||||
0,
|
0,
|
||||||
{}
|
{}
|
||||||
].forEach(value => test(t => {
|
].forEach(value => test(t => {
|
||||||
assert_throws(new TypeError(), () => new Blob([], {endings: value}),
|
assert_throws_js(TypeError, () => new Blob([], {endings: value}),
|
||||||
'Blob constructor should throw');
|
'Blob constructor should throw');
|
||||||
}, `Invalid "endings" value: ${JSON.stringify(value)}`));
|
}, `Invalid "endings" value: ${JSON.stringify(value)}`));
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ test(function() {
|
|||||||
assert_equals(blob.type, "");
|
assert_equals(blob.type, "");
|
||||||
}, "Blob constructor with no arguments");
|
}, "Blob constructor with no arguments");
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() { var blob = Blob(); });
|
assert_throws_js(TypeError, function() { var blob = Blob(); });
|
||||||
}, "Blob constructor with no arguments, without 'new'");
|
}, "Blob constructor with no arguments, without 'new'");
|
||||||
test(function() {
|
test(function() {
|
||||||
var blob = new Blob;
|
var blob = new Blob;
|
||||||
@ -59,7 +59,7 @@ test(function() {
|
|||||||
window,
|
window,
|
||||||
];
|
];
|
||||||
args.forEach(function(arg) {
|
args.forEach(function(arg) {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new Blob(arg);
|
new Blob(arg);
|
||||||
}, "Should throw for argument " + format_value(arg) + ".");
|
}, "Should throw for argument " + format_value(arg) + ".");
|
||||||
});
|
});
|
||||||
@ -226,7 +226,7 @@ test(function() {
|
|||||||
valueOf: function() { assert_unreached("Should not call valueOf if toString is present."); }
|
valueOf: function() { assert_unreached("Should not call valueOf if toString is present."); }
|
||||||
}]);
|
}]);
|
||||||
}, "Throwing toString and valueOf");
|
}, "Throwing toString and valueOf");
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new Blob([{toString: null, valueOf: null}]);
|
new Blob([{toString: null, valueOf: null}]);
|
||||||
}, "Null toString and valueOf");
|
}, "Null toString and valueOf");
|
||||||
}, "ToString should be called on elements of the blobParts array and any exceptions should be propagated.");
|
}, "ToString should be called on elements of the blobParts array and any exceptions should be propagated.");
|
||||||
@ -464,7 +464,7 @@ test(function() {
|
|||||||
'abc'
|
'abc'
|
||||||
].forEach(arg => {
|
].forEach(arg => {
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new TypeError(), () => new Blob([], arg),
|
assert_throws_js(TypeError, () => new Blob([], arg),
|
||||||
'Blob constructor should throw with invalid property bag');
|
'Blob constructor should throw with invalid property bag');
|
||||||
}, `Passing ${JSON.stringify(arg)} for options should throw`);
|
}, `Passing ${JSON.stringify(arg)} for options should throw`);
|
||||||
});
|
});
|
||||||
|
@ -36,7 +36,7 @@ function readBlobAsPromise(blob) {
|
|||||||
0,
|
0,
|
||||||
{}
|
{}
|
||||||
].forEach(value => test(t => {
|
].forEach(value => test(t => {
|
||||||
assert_throws(new TypeError(), () => new File([], "name", {endings: value}),
|
assert_throws_js(TypeError, () => new File([], "name", {endings: value}),
|
||||||
'File constructor should throw');
|
'File constructor should throw');
|
||||||
}, `Invalid "endings" value: ${JSON.stringify(value)}`));
|
}, `Invalid "endings" value: ${JSON.stringify(value)}`));
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@ test(function() {
|
|||||||
}, "File interface object exists");
|
}, "File interface object exists");
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new TypeError(), () => new File(),
|
assert_throws_js(TypeError, () => new File(),
|
||||||
'Bits argument is required');
|
'Bits argument is required');
|
||||||
assert_throws(new TypeError(), () => new File([]),
|
assert_throws_js(TypeError, () => new File([]),
|
||||||
'Name argument is required');
|
'Name argument is required');
|
||||||
}, 'Required arguments');
|
}, 'Required arguments');
|
||||||
|
|
||||||
@ -64,13 +64,13 @@ test_first_argument({[Symbol.iterator]() {
|
|||||||
null
|
null
|
||||||
].forEach(arg => {
|
].forEach(arg => {
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new TypeError(), () => new File(arg, 'world.html'),
|
assert_throws_js(TypeError, () => new File(arg, 'world.html'),
|
||||||
'Constructor should throw for invalid bits argument');
|
'Constructor should throw for invalid bits argument');
|
||||||
}, `Invalid bits argument: ${JSON.stringify(arg)}`);
|
}, `Invalid bits argument: ${JSON.stringify(arg)}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new Error(), () => new File([to_string_throws], 'name.txt'),
|
assert_throws_js(Error, () => new File([to_string_throws], 'name.txt'),
|
||||||
'Constructor should propagate exceptions');
|
'Constructor should propagate exceptions');
|
||||||
}, 'Bits argument: object that throws');
|
}, 'Bits argument: object that throws');
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ test(function() {
|
|||||||
'abc'
|
'abc'
|
||||||
].forEach(arg => {
|
].forEach(arg => {
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new TypeError(), () => new File(['bits'], 'name.txt', arg),
|
assert_throws_js(TypeError, () => new File(['bits'], 'name.txt', arg),
|
||||||
'Constructor should throw for invalid property bag type');
|
'Constructor should throw for invalid property bag type');
|
||||||
}, `Invalid property bag: ${JSON.stringify(arg)}`);
|
}, `Invalid property bag: ${JSON.stringify(arg)}`);
|
||||||
});
|
});
|
||||||
@ -150,7 +150,7 @@ test(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new Error(),
|
assert_throws_js(Error,
|
||||||
() => new File(['bits'], 'name.txt', {type: to_string_throws}),
|
() => new File(['bits'], 'name.txt', {type: to_string_throws}),
|
||||||
'Constructor should propagate exceptions');
|
'Constructor should propagate exceptions');
|
||||||
}, 'Property bag propagates exceptions');
|
}, 'Property bag propagates exceptions');
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
var cursor = e.target.result;
|
var cursor = e.target.result;
|
||||||
|
|
||||||
assert_true(cursor != null, "cursor exist");
|
assert_true(cursor != null, "cursor exist");
|
||||||
assert_throws(new TypeError(),
|
assert_throws_js(TypeError,
|
||||||
function() { cursor.advance(document); });
|
function() { cursor.advance(document); });
|
||||||
|
|
||||||
t.done();
|
t.done();
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
var cursor = e.target.result;
|
var cursor = e.target.result;
|
||||||
|
|
||||||
assert_true(cursor != null, "cursor exist");
|
assert_true(cursor != null, "cursor exist");
|
||||||
assert_throws(new TypeError(),
|
assert_throws_js(TypeError,
|
||||||
function() { cursor.advance(-1); });
|
function() { cursor.advance(-1); });
|
||||||
|
|
||||||
t.done();
|
t.done();
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
var cursor = event.target.result;
|
var cursor = event.target.result;
|
||||||
assert_true(cursor instanceof IDBCursor);
|
assert_true(cursor instanceof IDBCursor);
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
cursor.advance(0);
|
cursor.advance(0);
|
||||||
}, "Calling advance() with count argument 0 should throw TypeError.");
|
}, "Calling advance() with count argument 0 should throw TypeError.");
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
var cursor = event.target.result;
|
var cursor = event.target.result;
|
||||||
assert_true(cursor instanceof IDBCursor);
|
assert_true(cursor instanceof IDBCursor);
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
cursor.advance(0);
|
cursor.advance(0);
|
||||||
}, "Calling advance() with count argument 0 should throw TypeError.");
|
}, "Calling advance() with count argument 0 should throw TypeError.");
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
var cursor = e.target.result;
|
var cursor = e.target.result;
|
||||||
assert_true(cursor instanceof IDBCursor);
|
assert_true(cursor instanceof IDBCursor);
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { cursor.update(); });
|
assert_throws_js(TypeError, function() { cursor.update(); });
|
||||||
t.done();
|
t.done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
var cursor = e.target.result;
|
var cursor = e.target.result;
|
||||||
assert_true(cursor instanceof IDBCursor);
|
assert_true(cursor instanceof IDBCursor);
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { cursor.update(); });
|
assert_throws_js(TypeError, function() { cursor.update(); });
|
||||||
t.done();
|
t.done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<div id=log></div>
|
<div id=log></div>
|
||||||
<script>
|
<script>
|
||||||
test( function() {
|
test( function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
indexedDB.cmp();
|
indexedDB.cmp();
|
||||||
});
|
});
|
||||||
}, "IDBFactory.cmp() - no argument");
|
}, "IDBFactory.cmp() - no argument");
|
||||||
|
@ -9,7 +9,7 @@ function should_throw(val, name) {
|
|||||||
name = ((typeof val == "object" && val) ? "object" : format_value(val))
|
name = ((typeof val == "object" && val) ? "object" : format_value(val))
|
||||||
}
|
}
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
window.indexedDB.open('test', val);
|
window.indexedDB.open('test', val);
|
||||||
});
|
});
|
||||||
}, "Calling open() with version argument " + name + " should throw TypeError.")
|
}, "Calling open() with version argument " + name + " should throw TypeError.")
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
// TypeError: bound requires more than 0 arguments
|
// TypeError: bound requires more than 0 arguments
|
||||||
test( function() {
|
test( function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
IDBKeyRange.bound();
|
IDBKeyRange.bound();
|
||||||
});
|
});
|
||||||
}, "IDBKeyRange.bound() - bound requires more than 0 arguments.");
|
}, "IDBKeyRange.bound() - bound requires more than 0 arguments.");
|
||||||
@ -67,10 +67,10 @@
|
|||||||
// ReferenceError: the variable is not defined
|
// ReferenceError: the variable is not defined
|
||||||
test( function() {
|
test( function() {
|
||||||
var goodVariable = 1;
|
var goodVariable = 1;
|
||||||
assert_throws(new ReferenceError(), function() {
|
assert_throws_js(ReferenceError, function() {
|
||||||
IDBKeyRange.bound(noExistingVariable, 1);
|
IDBKeyRange.bound(noExistingVariable, 1);
|
||||||
});
|
});
|
||||||
assert_throws(new ReferenceError(), function() {
|
assert_throws_js(ReferenceError, function() {
|
||||||
IDBKeyRange.bound(goodVariable, noExistingVariable);
|
IDBKeyRange.bound(goodVariable, noExistingVariable);
|
||||||
});
|
});
|
||||||
}, "IDBKeyRange.bound(noExistingVariable, 1 / goodVariable, noExistingVariable) - noExistingVariable is not defined.");
|
}, "IDBKeyRange.bound(noExistingVariable, 1 / goodVariable, noExistingVariable) - noExistingVariable is not defined.");
|
||||||
|
@ -46,7 +46,7 @@ promise_test(async testCase => {
|
|||||||
createBooksStore(testCase, db);
|
createBooksStore(testCase, db);
|
||||||
});
|
});
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
db.transaction(['books'], 'readwrite', { durability: 'invalid' });
|
db.transaction(['books'], 'readwrite', { durability: 'invalid' });
|
||||||
});
|
});
|
||||||
db.close();
|
db.close();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => DOMException());
|
assert_throws_js(TypeError, () => DOMException());
|
||||||
}, "Cannot construct without new");
|
}, "Cannot construct without new");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
@ -26,7 +26,7 @@ test(() => {
|
|||||||
test(() => {
|
test(() => {
|
||||||
const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "message").get;
|
const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "message").get;
|
||||||
|
|
||||||
assert_throws(new TypeError(), () => getter.apply({}));
|
assert_throws_js(TypeError, () => getter.apply({}));
|
||||||
}, "message getter performs brand checks (i.e. is not [LenientThis]");
|
}, "message getter performs brand checks (i.e. is not [LenientThis]");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
@ -43,7 +43,7 @@ test(() => {
|
|||||||
test(() => {
|
test(() => {
|
||||||
const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "name").get;
|
const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "name").get;
|
||||||
|
|
||||||
assert_throws(new TypeError(), () => getter.apply({}));
|
assert_throws_js(TypeError, () => getter.apply({}));
|
||||||
}, "name getter performs brand checks (i.e. is not [LenientThis]");
|
}, "name getter performs brand checks (i.e. is not [LenientThis]");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
@ -60,7 +60,7 @@ test(() => {
|
|||||||
test(() => {
|
test(() => {
|
||||||
const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "code").get;
|
const getter = Object.getOwnPropertyDescriptor(DOMException.prototype, "code").get;
|
||||||
|
|
||||||
assert_throws(new TypeError(), () => getter.apply({}));
|
assert_throws_js(TypeError, () => getter.apply({}));
|
||||||
}, "code getter performs brand checks (i.e. is not [LenientThis]");
|
}, "code getter performs brand checks (i.e. is not [LenientThis]");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
@ -98,7 +98,7 @@ test(() => {
|
|||||||
}, "toString() behavior from Error.prototype applies as expected");
|
}, "toString() behavior from Error.prototype applies as expected");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => DOMException.prototype.toString());
|
assert_throws_js(TypeError, () => DOMException.prototype.toString());
|
||||||
}, "DOMException.prototype.toString() applied to DOMException.prototype throws because of name/message brand checks");
|
}, "DOMException.prototype.toString() applied to DOMException.prototype throws because of name/message brand checks");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
|
@ -10,7 +10,7 @@ setup(() => {
|
|||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
for (const object of objects) {
|
for (const object of objects) {
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
Object.setPrototypeOf(object, {});
|
Object.setPrototypeOf(object, {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -23,16 +23,16 @@ test(() => {
|
|||||||
const usp = new URLSearchParams();
|
const usp = new URLSearchParams();
|
||||||
const iteratorProto = Object.getPrototypeOf(usp.entries());
|
const iteratorProto = Object.getPrototypeOf(usp.entries());
|
||||||
|
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
iteratorProto.next();
|
iteratorProto.next();
|
||||||
});
|
});
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
iteratorProto.next.call(undefined);
|
iteratorProto.next.call(undefined);
|
||||||
});
|
});
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
iteratorProto.next.call(42);
|
iteratorProto.next.call(42);
|
||||||
});
|
});
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
iteratorProto.next.call(new Headers().entries());
|
iteratorProto.next.call(new Headers().entries());
|
||||||
});
|
});
|
||||||
}, "next() throws TypeError when called on ineligible receiver");
|
}, "next() throws TypeError when called on ineligible receiver");
|
||||||
|
@ -23,8 +23,8 @@ test(() => {
|
|||||||
}, "Must have the correct property descriptor");
|
}, "Must have the correct property descriptor");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => NodeFilter(), "call");
|
assert_throws_js(TypeError, () => NodeFilter(), "call");
|
||||||
assert_throws(new TypeError(), () => new NodeFilter(), "construct");
|
assert_throws_js(TypeError, () => new NodeFilter(), "construct");
|
||||||
}, "Must throw a TypeError when called or constructed")
|
}, "Must throw a TypeError when called or constructed")
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
@ -59,10 +59,10 @@ test(() => {
|
|||||||
|
|
||||||
// OrdinaryHasInstance throws a TypeError if the right-hand-side doesn't have a .prototype object,
|
// OrdinaryHasInstance throws a TypeError if the right-hand-side doesn't have a .prototype object,
|
||||||
// which is the case for callback interfaces.
|
// which is the case for callback interfaces.
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
(function () { }) instanceof NodeFilter;
|
(function () { }) instanceof NodeFilter;
|
||||||
});
|
});
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
({ }) instanceof NodeFilter;
|
({ }) instanceof NodeFilter;
|
||||||
});
|
});
|
||||||
}, "instanceof must throw but only when we don't bail out early");
|
}, "instanceof must throw but only when we don't bail out early");
|
||||||
|
@ -121,17 +121,17 @@ test(function() {
|
|||||||
configurable: true});
|
configurable: true});
|
||||||
assert_prop_desc_equals(domTokenList, "1", undefined);
|
assert_prop_desc_equals(domTokenList, "1", undefined);
|
||||||
// Actual test
|
// Actual test
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(domTokenList, "0", {value: true, writable: true}));
|
Object.defineProperty(domTokenList, "0", {value: true, writable: true}));
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(domTokenList, "1", {value: true, writable: true}));
|
Object.defineProperty(domTokenList, "1", {value: true, writable: true}));
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(domTokenList, "0", {get: () => {}}));
|
Object.defineProperty(domTokenList, "0", {get: () => {}}));
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(domTokenList, "0", {set: () => {}}));
|
Object.defineProperty(domTokenList, "0", {set: () => {}}));
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(domTokenList, "1", {get: () => {}}));
|
Object.defineProperty(domTokenList, "1", {get: () => {}}));
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(domTokenList, "1", {set: () => {}}));
|
Object.defineProperty(domTokenList, "1", {set: () => {}}));
|
||||||
assert_equals(domTokenList[0], "foo");
|
assert_equals(domTokenList[0], "foo");
|
||||||
assert_equals(domTokenList[1], undefined);
|
assert_equals(domTokenList[1], undefined);
|
||||||
@ -139,11 +139,11 @@ test(function() {
|
|||||||
domTokenList[1] = "bar";
|
domTokenList[1] = "bar";
|
||||||
assert_equals(domTokenList[0], "foo");
|
assert_equals(domTokenList[0], "foo");
|
||||||
assert_equals(domTokenList[1], undefined);
|
assert_equals(domTokenList[1], undefined);
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
"use strict";
|
"use strict";
|
||||||
domTokenList[0] = "bar";
|
domTokenList[0] = "bar";
|
||||||
});
|
});
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
"use strict";
|
"use strict";
|
||||||
domTokenList[1] = "bar";
|
domTokenList[1] = "bar";
|
||||||
});
|
});
|
||||||
@ -164,9 +164,9 @@ test(function() {
|
|||||||
assert_equals(select.length, 0);
|
assert_equals(select.length, 0);
|
||||||
assert_prop_desc_equals(select, "0", undefined);
|
assert_prop_desc_equals(select, "0", undefined);
|
||||||
// Try to define an accessor property with non supported property index.
|
// Try to define an accessor property with non supported property index.
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(select, "0", {get: () => {}}));
|
Object.defineProperty(select, "0", {get: () => {}}));
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(select, "0", {set: () => {}}));
|
Object.defineProperty(select, "0", {set: () => {}}));
|
||||||
assert_prop_desc_equals(select, "0", undefined);
|
assert_prop_desc_equals(select, "0", undefined);
|
||||||
// writable, enumerable, configurable will be ignored.
|
// writable, enumerable, configurable will be ignored.
|
||||||
@ -180,9 +180,9 @@ test(function() {
|
|||||||
{value: option1, writable: true, enumerable: true,
|
{value: option1, writable: true, enumerable: true,
|
||||||
configurable: true});
|
configurable: true});
|
||||||
// Try to define an accessor property with a supported property index.
|
// Try to define an accessor property with a supported property index.
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(select, "0", {get: () => {}}));
|
Object.defineProperty(select, "0", {get: () => {}}));
|
||||||
assert_throws(new TypeError(), () =>
|
assert_throws_js(TypeError, () =>
|
||||||
Object.defineProperty(select, "0", {set: () => {}}));
|
Object.defineProperty(select, "0", {set: () => {}}));
|
||||||
assert_prop_desc_equals(select, "0",
|
assert_prop_desc_equals(select, "0",
|
||||||
{value: option0, writable: true, enumerable: true,
|
{value: option0, writable: true, enumerable: true,
|
||||||
|
@ -77,7 +77,7 @@ test(() => {
|
|||||||
set: descriptor.set
|
set: descriptor.set
|
||||||
});
|
});
|
||||||
|
|
||||||
assert_throws(new SyntaxError(), () => {
|
assert_throws_js(SyntaxError, () => {
|
||||||
element.style = "color: green";
|
element.style = "color: green";
|
||||||
});
|
});
|
||||||
}, "Exception propagation from getter of [PutForwards] attribute");
|
}, "Exception propagation from getter of [PutForwards] attribute");
|
||||||
@ -94,7 +94,7 @@ test(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
assert_throws(new SyntaxError(), () => {
|
assert_throws_js(SyntaxError, () => {
|
||||||
element.style = "color: green";
|
element.style = "color: green";
|
||||||
});
|
});
|
||||||
}, "Exception propagation from setter of [PutForwards] target attribute");
|
}, "Exception propagation from setter of [PutForwards] target attribute");
|
||||||
@ -110,7 +110,7 @@ test(() => {
|
|||||||
set: descriptor.set
|
set: descriptor.set
|
||||||
});
|
});
|
||||||
|
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
element.style = "color: green";
|
element.style = "color: green";
|
||||||
});
|
});
|
||||||
}, "TypeError when getter of [PutForwards] attribute returns non-object");
|
}, "TypeError when getter of [PutForwards] attribute returns non-object");
|
||||||
|
@ -151,7 +151,7 @@ test(t => {
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
// Should fail rather than falling back to record
|
// Should fail rather than falling back to record
|
||||||
assert_throws(new TypeError(), function() { new URLSearchParams(["key", "value"]); });
|
assert_throws_js(TypeError, function() { new URLSearchParams(["key", "value"]); });
|
||||||
}, "A string array in sequence<sequence> or record");
|
}, "A string array in sequence<sequence> or record");
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -13,13 +13,13 @@ test(function() {
|
|||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
var invalidUrl = "http://invalid:url";
|
var invalidUrl = "http://invalid:url";
|
||||||
assert_throws(new TypeError(), function() { navigator.sendBeacon(invalidUrl, smallPayload); },
|
assert_throws_js(TypeError, function() { navigator.sendBeacon(invalidUrl, smallPayload); },
|
||||||
`calling 'navigator.sendBeacon()' with an invalid URL '${invalidUrl}' must throw a TypeError`);
|
`calling 'navigator.sendBeacon()' with an invalid URL '${invalidUrl}' must throw a TypeError`);
|
||||||
}, "Verify calling 'navigator.sendBeacon()' with an invalid URL throws an exception.");
|
}, "Verify calling 'navigator.sendBeacon()' with an invalid URL throws an exception.");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
var invalidUrl = "nothttp://invalid.url";
|
var invalidUrl = "nothttp://invalid.url";
|
||||||
assert_throws(new TypeError(), function() { navigator.sendBeacon(invalidUrl, smallPayload); },
|
assert_throws_js(TypeError, function() { navigator.sendBeacon(invalidUrl, smallPayload); },
|
||||||
`calling 'navigator.sendBeacon()' with a non-http(s) URL '${invalidUrl}' must throw a TypeError`);
|
`calling 'navigator.sendBeacon()' with a non-http(s) URL '${invalidUrl}' must throw a TypeError`);
|
||||||
}, "Verify calling 'navigator.sendBeacon()' with a URL that is not a http(s) scheme throws an exception.");
|
}, "Verify calling 'navigator.sendBeacon()' with a URL that is not a http(s) scheme throws an exception.");
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => navigator.sendBeacon("...", new ReadableStream()));
|
assert_throws_js(TypeError, () => navigator.sendBeacon("...", new ReadableStream()));
|
||||||
}, "sendBeacon() with a stream does not work due to the keepalive flag being set");
|
}, "sendBeacon() with a stream does not work due to the keepalive flag being set");
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
const test_desc = 'Bluetooth IDL test';
|
const test_desc = 'Bluetooth IDL test';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(
|
assert_throws_js(
|
||||||
new TypeError(), () => new Bluetooth(),
|
TypeError, () => new Bluetooth(),
|
||||||
'the constructor should not be callable with "new"');
|
'the constructor should not be callable with "new"');
|
||||||
assert_throws(
|
assert_throws_js(
|
||||||
new TypeError(), () => Bluetooth(),
|
TypeError, () => Bluetooth(),
|
||||||
'the constructor should not be callable');
|
'the constructor should not be callable');
|
||||||
|
|
||||||
// Bluetooth implements BluetoothDiscovery;
|
// Bluetooth implements BluetoothDiscovery;
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
const test_desc_idl = 'BluetoothDevice IDL test.';
|
const test_desc_idl = 'BluetoothDevice IDL test.';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(
|
assert_throws_js(
|
||||||
new TypeError(), () => new BluetoothDevice(),
|
TypeError, () => new BluetoothDevice(),
|
||||||
'the constructor should not be callable with "new"');
|
'the constructor should not be callable with "new"');
|
||||||
assert_throws(
|
assert_throws_js(
|
||||||
new TypeError(), () => BluetoothDevice(),
|
TypeError, () => BluetoothDevice(),
|
||||||
'the constructor should not be callable');
|
'the constructor should not be callable');
|
||||||
}, test_desc_idl);
|
}, test_desc_idl);
|
||||||
|
|
||||||
@ -23,11 +23,11 @@ bluetooth_test(
|
|||||||
() => getConnectedHealthThermometerDevice().then(({device}) => {
|
() => getConnectedHealthThermometerDevice().then(({device}) => {
|
||||||
assert_equals(device.constructor.name, 'BluetoothDevice');
|
assert_equals(device.constructor.name, 'BluetoothDevice');
|
||||||
var old_device_id = device.id;
|
var old_device_id = device.id;
|
||||||
assert_throws(
|
assert_throws_js(
|
||||||
new TypeError(), () => device.id = 'overwritten',
|
TypeError, () => device.id = 'overwritten',
|
||||||
'the device id should not be writable');
|
'the device id should not be writable');
|
||||||
assert_throws(
|
assert_throws_js(
|
||||||
new TypeError(), () => device.name = 'overwritten',
|
TypeError, () => device.name = 'overwritten',
|
||||||
'the device name should not be writable');
|
'the device name should not be writable');
|
||||||
assert_equals(device.id, old_device_id);
|
assert_equals(device.id, old_device_id);
|
||||||
assert_equals(device.name, 'Health Thermometer');
|
assert_equals(device.name, 'Health Thermometer');
|
||||||
|
@ -19,19 +19,19 @@ test(() => {
|
|||||||
}, "ClipboardItem() succeeds with empty options");
|
}, "ClipboardItem() succeeds with empty options");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => {new ClipboardItem({});});
|
assert_throws_js(TypeError, () => {new ClipboardItem({});});
|
||||||
}, "ClipboardItem({}) fails with empty dictionary input");
|
}, "ClipboardItem({}) fails with empty dictionary input");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => {new ClipboardItem(blob);});
|
assert_throws_js(TypeError, () => {new ClipboardItem(blob);});
|
||||||
}, "ClipboardItem(Blob) fails");
|
}, "ClipboardItem(Blob) fails");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => {new ClipboardItem(null);});
|
assert_throws_js(TypeError, () => {new ClipboardItem(null);});
|
||||||
}, "ClipboardItem() fails with null input");
|
}, "ClipboardItem() fails with null input");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => {new ClipboardItem();});
|
assert_throws_js(TypeError, () => {new ClipboardItem();});
|
||||||
}, "ClipboardItem() fails with no input");
|
}, "ClipboardItem() fails with no input");
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
|
@ -3,7 +3,7 @@ function test_stringifier_attribute(aObject, aAttribute, aIsUnforgeable) {
|
|||||||
// Step 1.
|
// Step 1.
|
||||||
test(function() {
|
test(function() {
|
||||||
[null, undefined].forEach(function(v) {
|
[null, undefined].forEach(function(v) {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
aObject.toString.call(v);
|
aObject.toString.call(v);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -15,7 +15,7 @@ function test_stringifier_attribute(aObject, aAttribute, aIsUnforgeable) {
|
|||||||
test(function() {
|
test(function() {
|
||||||
assert_false("Window" in window && aObject instanceof window.Window);
|
assert_false("Window" in window && aObject instanceof window.Window);
|
||||||
[{}, window].forEach(function(v) {
|
[{}, window].forEach(function(v) {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
aObject.toString.call(v)
|
aObject.toString.call(v)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -33,7 +33,7 @@ async function compressArrayBuffer(input, format) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
const transformer = new CompressionStream("nonvalid");
|
const transformer = new CompressionStream("nonvalid");
|
||||||
}, "non supported format should throw");
|
}, "non supported format should throw");
|
||||||
}, "CompressionStream constructor should throw on invalid format");
|
}, "CompressionStream constructor should throw on invalid format");
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new TypeError(), () => new DecompressionStream('a'), 'constructor should throw');
|
assert_throws_js(TypeError, () => new DecompressionStream('a'), 'constructor should throw');
|
||||||
}, '"a" should cause the constructor to throw');
|
}, '"a" should cause the constructor to throw');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new TypeError(), () => new DecompressionStream(), 'constructor should throw');
|
assert_throws_js(TypeError, () => new DecompressionStream(), 'constructor should throw');
|
||||||
}, 'no input should cause the constructor to throw');
|
}, 'no input should cause the constructor to throw');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
assert_throws(new Error(), () => new DecompressionStream({ toString() { throw Error(); } }), 'constructor should throw');
|
assert_throws_js(Error, () => new DecompressionStream({ toString() { throw Error(); } }), 'constructor should throw');
|
||||||
}, 'non-string input should cause the constructor to throw');
|
}, 'non-string input should cause the constructor to throw');
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
var evalRan = false;
|
var evalRan = false;
|
||||||
|
|
||||||
test(function() {assert_throws(new EvalError(), function() { eval('evalRan = true;') })}, "eval() should throw without 'unsafe-eval' keyword source in script-src directive.");
|
test(function() {assert_throws_js(EvalError, function() { eval('evalRan = true;') })}, "eval() should throw without 'unsafe-eval' keyword source in script-src directive.");
|
||||||
|
|
||||||
test(function() {assert_false(evalRan);})
|
test(function() {assert_false(evalRan);})
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(
|
assert_throws_js(
|
||||||
new EvalError(),
|
EvalError,
|
||||||
function() {
|
function() {
|
||||||
var funq = new Function('');
|
var funq = new Function('');
|
||||||
funq();
|
funq();
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
assert_equals(e.effectiveDirective, 'script-src');
|
assert_equals(e.effectiveDirective, 'script-src');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
assert_throws(new Error(),
|
assert_throws_js(Error,
|
||||||
function() {
|
function() {
|
||||||
try {
|
try {
|
||||||
eval("evalScriptRan = true;");
|
eval("evalScriptRan = true;");
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
assert_equals(e.effectiveDirective, 'script-src');
|
assert_equals(e.effectiveDirective, 'script-src');
|
||||||
}));
|
}));
|
||||||
|
|
||||||
assert_throws(new Error(),
|
assert_throws_js(Error,
|
||||||
function() {
|
function() {
|
||||||
try {
|
try {
|
||||||
new Function('newFunctionScriptRan = true;')();
|
new Function('newFunctionScriptRan = true;')();
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
}, "the event inherts from Event");
|
}, "the event inherts from Event");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new AnimationEvent();
|
new AnimationEvent();
|
||||||
}, 'First argument is required, so was expecting a TypeError.');
|
}, 'First argument is required, so was expecting a TypeError.');
|
||||||
}, 'Missing type argument');
|
}, 'Missing type argument');
|
||||||
@ -176,37 +176,37 @@
|
|||||||
}, "elapsedTime set to an object with a valueOf function");
|
}, "elapsedTime set to an object with a valueOf function");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new AnimationEvent("test", {elapsedTime: NaN});
|
new AnimationEvent("test", {elapsedTime: NaN});
|
||||||
}, 'elapsedTime cannot be NaN so was expecting a TypeError');
|
}, 'elapsedTime cannot be NaN so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to NaN");
|
}, "elapsedTime cannot be set to NaN");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new AnimationEvent("test", {elapsedTime: Infinity});
|
new AnimationEvent("test", {elapsedTime: Infinity});
|
||||||
}, 'elapsedTime cannot be Infinity so was expecting a TypeError');
|
}, 'elapsedTime cannot be Infinity so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to Infinity");
|
}, "elapsedTime cannot be set to Infinity");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new AnimationEvent("test", {elapsedTime: -Infinity});
|
new AnimationEvent("test", {elapsedTime: -Infinity});
|
||||||
}, 'elapsedTime cannot be -Infinity so was expecting a TypeError');
|
}, 'elapsedTime cannot be -Infinity so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to -Infinity");
|
}, "elapsedTime cannot be set to -Infinity");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new AnimationEvent("test", {elapsedTime: "sample"});
|
new AnimationEvent("test", {elapsedTime: "sample"});
|
||||||
}, 'elapsedTime cannot be a string so was expecting a TypeError');
|
}, 'elapsedTime cannot be a string so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to 'sample'");
|
}, "elapsedTime cannot be set to 'sample'");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new AnimationEvent("test", {elapsedTime: [0.5, 1.0]});
|
new AnimationEvent("test", {elapsedTime: [0.5, 1.0]});
|
||||||
}, 'elapsedTime cannot be a multi-element array so was expecting a TypeError');
|
}, 'elapsedTime cannot be a multi-element array so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to [0.5, 1.0]");
|
}, "elapsedTime cannot be set to [0.5, 1.0]");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new AnimationEvent("test", {elapsedTime: { sample: 0.5}});
|
new AnimationEvent("test", {elapsedTime: { sample: 0.5}});
|
||||||
}, 'elapsedTime cannot be an object so was expecting a TypeError');
|
}, 'elapsedTime cannot be an object so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to an object");
|
}, "elapsedTime cannot be set to an object");
|
||||||
|
@ -200,7 +200,7 @@
|
|||||||
test(function(){
|
test(function(){
|
||||||
var style_rule = document.styleSheets[0].cssRules[0].cssRules[1];
|
var style_rule = document.styleSheets[0].cssRules[0].cssRules[1];
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { style_rule.insertRule("@supports (width: 0) { ol { width: 0; } }", 0);} );
|
assert_throws_js(TypeError, function() { style_rule.insertRule("@supports (width: 0) { ol { width: 0; } }", 0);} );
|
||||||
|
|
||||||
}, "Inserting an @supports inside a style rule should fail");
|
}, "Inserting an @supports inside a style rule should fail");
|
||||||
test(function(){
|
test(function(){
|
||||||
|
@ -33,9 +33,9 @@ test(function(){
|
|||||||
}, 'Generated properties respect inherits flag');
|
}, 'Generated properties respect inherits flag');
|
||||||
|
|
||||||
test(function(){
|
test(function(){
|
||||||
assert_throws(new Error(), () => generate_property({syntax: '<length>', foo: 1}));
|
assert_throws_js(Error, () => generate_property({syntax: '<length>', foo: 1}));
|
||||||
assert_throws(new Error(), () => generate_property({syntax: '<length>', inherited: false}));
|
assert_throws_js(Error, () => generate_property({syntax: '<length>', inherited: false}));
|
||||||
assert_throws(new Error(), () => generate_property({syntax: '<length>', initial: '10px'}));
|
assert_throws_js(Error, () => generate_property({syntax: '<length>', initial: '10px'}));
|
||||||
}, 'Can\'t generate property with unknown fields');
|
}, 'Can\'t generate property with unknown fields');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -44,14 +44,14 @@ function verify_map_set(map, name, value) {
|
|||||||
|
|
||||||
// Verifies that the specified value is NOT accepted by set().
|
// Verifies that the specified value is NOT accepted by set().
|
||||||
function verify_map_not_set(map, name, value) {
|
function verify_map_not_set(map, name, value) {
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
map.set(name, value);
|
map.set(name, value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verifies that the specified value is NOT accepted by append().
|
// Verifies that the specified value is NOT accepted by append().
|
||||||
function verify_map_no_append(map, name, value) {
|
function verify_map_no_append(map, name, value) {
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
map.append(name, value);
|
map.append(name, value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ test(function() {
|
|||||||
}, "the event inherts from Event");
|
}, "the event inherts from Event");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new TransitionEvent();
|
new TransitionEvent();
|
||||||
}, 'First argument is required, so was expecting a TypeError.');
|
}, 'First argument is required, so was expecting a TypeError.');
|
||||||
}, 'Missing type argument');
|
}, 'Missing type argument');
|
||||||
@ -185,37 +185,37 @@ test(function() {
|
|||||||
}, "elapsedTime set to an object with a valueOf function");
|
}, "elapsedTime set to an object with a valueOf function");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new TransitionEvent("test", {elapsedTime: NaN});
|
new TransitionEvent("test", {elapsedTime: NaN});
|
||||||
}, 'elapsedTime cannot be NaN so was expecting a TypeError');
|
}, 'elapsedTime cannot be NaN so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to NaN");
|
}, "elapsedTime cannot be set to NaN");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new TransitionEvent("test", {elapsedTime: Infinity});
|
new TransitionEvent("test", {elapsedTime: Infinity});
|
||||||
}, 'elapsedTime cannot be Infinity so was expecting a TypeError');
|
}, 'elapsedTime cannot be Infinity so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to Infinity");
|
}, "elapsedTime cannot be set to Infinity");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new TransitionEvent("test", {elapsedTime: -Infinity});
|
new TransitionEvent("test", {elapsedTime: -Infinity});
|
||||||
}, 'elapsedTime cannot be -Infinity so was expecting a TypeError');
|
}, 'elapsedTime cannot be -Infinity so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to -Infinity");
|
}, "elapsedTime cannot be set to -Infinity");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new TransitionEvent("test", {elapsedTime: "sample"});
|
new TransitionEvent("test", {elapsedTime: "sample"});
|
||||||
}, 'elapsedTime cannot be a string so was expecting a TypeError');
|
}, 'elapsedTime cannot be a string so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to 'sample'");
|
}, "elapsedTime cannot be set to 'sample'");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new TransitionEvent("test", {elapsedTime: [0.5, 1.0]});
|
new TransitionEvent("test", {elapsedTime: [0.5, 1.0]});
|
||||||
}, 'elapsedTime cannot be a multi-element array so was expecting a TypeError');
|
}, 'elapsedTime cannot be a multi-element array so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to [0.5, 1.0]");
|
}, "elapsedTime cannot be set to [0.5, 1.0]");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
new TransitionEvent("test", {elapsedTime: { sample: 0.5}});
|
new TransitionEvent("test", {elapsedTime: { sample: 0.5}});
|
||||||
}, 'elapsedTime cannot be an object so was expecting a TypeError');
|
}, 'elapsedTime cannot be an object so was expecting a TypeError');
|
||||||
}, "elapsedTime cannot be set to an object");
|
}, "elapsedTime cannot be set to an object");
|
||||||
|
@ -11,23 +11,23 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parse('', 'auto'));
|
assert_throws_js(TypeError, () => CSSStyleValue.parse('', 'auto'));
|
||||||
}, 'CSSStyleValue.parse() with empty property name throws TypeError');
|
}, 'CSSStyleValue.parse() with empty property name throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parse('lemon', 'auto'));
|
assert_throws_js(TypeError, () => CSSStyleValue.parse('lemon', 'auto'));
|
||||||
}, 'CSSStyleValue.parse() with unsupported property name throws TypeError');
|
}, 'CSSStyleValue.parse() with unsupported property name throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parse('width', '10deg'));
|
assert_throws_js(TypeError, () => CSSStyleValue.parse('width', '10deg'));
|
||||||
}, 'CSSStyleValue.parse() with invalid value for valid property throws TypeError');
|
}, 'CSSStyleValue.parse() with invalid value for valid property throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parse('margin', '10deg'));
|
assert_throws_js(TypeError, () => CSSStyleValue.parse('margin', '10deg'));
|
||||||
}, 'CSSStyleValue.parse() with invalid value for shorthand property throws TypeError');
|
}, 'CSSStyleValue.parse() with invalid value for shorthand property throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parse('--foo', ''));
|
assert_throws_js(TypeError, () => CSSStyleValue.parse('--foo', ''));
|
||||||
}, 'CSSStyleValue.parse() with invalid value for custom property throws TypeError');
|
}, 'CSSStyleValue.parse() with invalid value for custom property throws TypeError');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,23 +11,23 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parseAll('', 'auto'));
|
assert_throws_js(TypeError, () => CSSStyleValue.parseAll('', 'auto'));
|
||||||
}, 'CSSStyleValue.parseAll() with empty property name throws TypeError');
|
}, 'CSSStyleValue.parseAll() with empty property name throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parseAll('lemon', 'auto'));
|
assert_throws_js(TypeError, () => CSSStyleValue.parseAll('lemon', 'auto'));
|
||||||
}, 'CSSStyleValue.parseAll() with unsupported property name throws TypeError');
|
}, 'CSSStyleValue.parseAll() with unsupported property name throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parseAll('width', '10deg'));
|
assert_throws_js(TypeError, () => CSSStyleValue.parseAll('width', '10deg'));
|
||||||
}, 'CSSStyleValue.parseAll() with invalid value for valid property throws TypeError');
|
}, 'CSSStyleValue.parseAll() with invalid value for valid property throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parseAll('margin', '10deg'));
|
assert_throws_js(TypeError, () => CSSStyleValue.parseAll('margin', '10deg'));
|
||||||
}, 'CSSStyleValue.parseAll() with invalid value for shorthand property throws TypeError');
|
}, 'CSSStyleValue.parseAll() with invalid value for shorthand property throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => CSSStyleValue.parseAll('--foo', ''));
|
assert_throws_js(TypeError, () => CSSStyleValue.parseAll('--foo', ''));
|
||||||
}, 'CSSStyleValue.parseAll() with invalid value for custom property throws TypeError');
|
}, 'CSSStyleValue.parseAll() with invalid value for custom property throws TypeError');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSKeywordValue(''));
|
assert_throws_js(TypeError, () => new CSSKeywordValue(''));
|
||||||
}, 'Constructing CSSKeywordValue with an empty string throws a TypeError');
|
}, 'Constructing CSSKeywordValue with an empty string throws a TypeError');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -27,7 +27,7 @@ for (const args of gTestArguments) {
|
|||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSKeywordValue('lemon');
|
let result = new CSSKeywordValue('lemon');
|
||||||
assert_throws(new TypeError(), () => result.value = '');
|
assert_throws_js(TypeError, () => result.value = '');
|
||||||
assert_equals(result.value, 'lemon', 'value does not change');
|
assert_equals(result.value, 'lemon', 'value does not change');
|
||||||
}, 'Updating CSSKeywordValue.value with an empty string throws a TypeError');
|
}, 'Updating CSSKeywordValue.value with an empty string throws a TypeError');
|
||||||
|
|
||||||
|
@ -20,14 +20,14 @@ const gInvalidTestCases = [
|
|||||||
|
|
||||||
for (const {length, desc} of gInvalidTestCases) {
|
for (const {length, desc} of gInvalidTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSPerspective(length));
|
assert_throws_js(TypeError, () => new CSSPerspective(length));
|
||||||
}, 'Constructing a CSSPerspective with ' + desc + ' throws a TypeError');
|
}, 'Constructing a CSSPerspective with ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const {length, desc} of gInvalidTestCases) {
|
for (const {length, desc} of gInvalidTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
let perspective = new CSSPerspective(CSS.px(0));
|
let perspective = new CSSPerspective(CSS.px(0));
|
||||||
assert_throws(new TypeError(), () => perspective.length = length);
|
assert_throws_js(TypeError, () => perspective.length = length);
|
||||||
assert_style_value_equals(perspective.length, CSS.px(0));
|
assert_style_value_equals(perspective.length, CSS.px(0));
|
||||||
}, 'Updating CSSPerspective.length with ' + desc + ' throws a TypeError');
|
}, 'Updating CSSPerspective.length with ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
@ -43,13 +43,13 @@ const gTestArguments = [
|
|||||||
|
|
||||||
for (const {value, description} of gTestArguments) {
|
for (const {value, description} of gTestArguments) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSPositionValue(value, CSS.px(0)));
|
assert_throws_js(TypeError, () => new CSSPositionValue(value, CSS.px(0)));
|
||||||
assert_throws(new TypeError(), () => new CSSPositionValue(CSS.px(0), value));
|
assert_throws_js(TypeError, () => new CSSPositionValue(CSS.px(0), value));
|
||||||
}, `Constructing a CSSPositionValue with ${description} throws a TypeError`);
|
}, `Constructing a CSSPositionValue with ${description} throws a TypeError`);
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
let position = new CSSPositionValue(CSS.px(0), CSS.px(0));
|
let position = new CSSPositionValue(CSS.px(0), CSS.px(0));
|
||||||
assert_throws(new TypeError(), () => position.x = value);
|
assert_throws_js(TypeError, () => position.x = value);
|
||||||
|
|
||||||
assert_equals(position.x.value, 0,
|
assert_equals(position.x.value, 0,
|
||||||
'X member should not have changed');
|
'X member should not have changed');
|
||||||
@ -57,7 +57,7 @@ for (const {value, description} of gTestArguments) {
|
|||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
let position = new CSSPositionValue(CSS.px(0), CSS.px(0));
|
let position = new CSSPositionValue(CSS.px(0), CSS.px(0));
|
||||||
assert_throws(new TypeError(), () => position.y = value);
|
assert_throws_js(TypeError, () => position.y = value);
|
||||||
|
|
||||||
assert_equals(position.y.value, 0,
|
assert_equals(position.y.value, 0,
|
||||||
'Y member should not have changed');
|
'Y member should not have changed');
|
||||||
|
@ -20,16 +20,16 @@ const gInvalidCoordTestCases = [
|
|||||||
|
|
||||||
for (const {angle, desc} of gInvalidAngleTestCases) {
|
for (const {angle, desc} of gInvalidAngleTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSRotate(angle));
|
assert_throws_js(TypeError, () => new CSSRotate(angle));
|
||||||
assert_throws(new TypeError(), () => new CSSRotate(0, 0, 0, angle));
|
assert_throws_js(TypeError, () => new CSSRotate(0, 0, 0, angle));
|
||||||
}, 'Constructing a CSSRotate with ' + desc + ' for the angle throws a TypeError');
|
}, 'Constructing a CSSRotate with ' + desc + ' for the angle throws a TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const {coord, desc} of gInvalidCoordTestCases) {
|
for (const {coord, desc} of gInvalidCoordTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSRotate(coord, 0, 0, CSS.deg(0)));
|
assert_throws_js(TypeError, () => new CSSRotate(coord, 0, 0, CSS.deg(0)));
|
||||||
assert_throws(new TypeError(), () => new CSSRotate(0, coord, 0, CSS.deg(0)));
|
assert_throws_js(TypeError, () => new CSSRotate(0, coord, 0, CSS.deg(0)));
|
||||||
assert_throws(new TypeError(), () => new CSSRotate(0, 0, coord, CSS.deg(0)));
|
assert_throws_js(TypeError, () => new CSSRotate(0, 0, coord, CSS.deg(0)));
|
||||||
}, 'Constructing a CSSRotate with ' + desc + ' for the coordinates throws a TypeError');
|
}, 'Constructing a CSSRotate with ' + desc + ' for the coordinates throws a TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ for (const attr of ['x', 'y', 'z']) {
|
|||||||
for (const {value, desc} of gInvalidCoordTestCases) {
|
for (const {value, desc} of gInvalidCoordTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSRotate(0, 0, 0, CSS.deg(0));
|
let result = new CSSRotate(0, 0, 0, CSS.deg(0));
|
||||||
assert_throws(new TypeError(), () => result[attr] = value);
|
assert_throws_js(TypeError, () => result[attr] = value);
|
||||||
assert_style_value_equals(result[attr], CSS.number(0));
|
assert_style_value_equals(result[attr], CSS.number(0));
|
||||||
}, 'Updating CSSRotate.' + attr + ' to ' + desc + ' throws a TypeError');
|
}, 'Updating CSSRotate.' + attr + ' to ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ for (const attr of ['x', 'y', 'z']) {
|
|||||||
for (const {angle, desc} of gInvalidAngleTestCases) {
|
for (const {angle, desc} of gInvalidAngleTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSRotate(CSS.deg(0));
|
let result = new CSSRotate(CSS.deg(0));
|
||||||
assert_throws(new TypeError(), () => result.angle = angle);
|
assert_throws_js(TypeError, () => result.angle = angle);
|
||||||
assert_style_value_equals(result.angle, CSS.deg(0));
|
assert_style_value_equals(result.angle, CSS.deg(0));
|
||||||
}, 'Updating CSSRotate.angle to ' + desc + ' throws a TypeError');
|
}, 'Updating CSSRotate.angle to ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,11 @@ const gInvalidCoordTestCases = [
|
|||||||
|
|
||||||
for (const {coord, desc} of gInvalidCoordTestCases) {
|
for (const {coord, desc} of gInvalidCoordTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSScale(coord, 0));
|
assert_throws_js(TypeError, () => new CSSScale(coord, 0));
|
||||||
assert_throws(new TypeError(), () => new CSSScale(0, coord));
|
assert_throws_js(TypeError, () => new CSSScale(0, coord));
|
||||||
assert_throws(new TypeError(), () => new CSSScale(coord, 0, 0));
|
assert_throws_js(TypeError, () => new CSSScale(coord, 0, 0));
|
||||||
assert_throws(new TypeError(), () => new CSSScale(0, coord, 0));
|
assert_throws_js(TypeError, () => new CSSScale(0, coord, 0));
|
||||||
assert_throws(new TypeError(), () => new CSSScale(0, 0, coord));
|
assert_throws_js(TypeError, () => new CSSScale(0, 0, coord));
|
||||||
}, 'Constructing a CSSScale with ' + desc + ' for the coordinates throws a TypeError');
|
}, 'Constructing a CSSScale with ' + desc + ' for the coordinates throws a TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ for (const attr of ['x', 'y', 'z']) {
|
|||||||
for (const {value, desc} of gInvalidCoordTestCases) {
|
for (const {value, desc} of gInvalidCoordTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSScale(0, 0, 0);
|
let result = new CSSScale(0, 0, 0);
|
||||||
assert_throws(new TypeError(), () => result[attr] = value);
|
assert_throws_js(TypeError, () => result[attr] = value);
|
||||||
assert_style_value_equals(result[attr], CSS.number(0));
|
assert_style_value_equals(result[attr], CSS.number(0));
|
||||||
}, 'Updating CSSScale.' + attr + ' to ' + desc + ' throws a TypeError');
|
}, 'Updating CSSScale.' + attr + ' to ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,8 @@ const gInvalidTestCases = [
|
|||||||
|
|
||||||
for (const {value, desc} of gInvalidTestCases) {
|
for (const {value, desc} of gInvalidTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSSkew(value, CSS.deg(0)));
|
assert_throws_js(TypeError, () => new CSSSkew(value, CSS.deg(0)));
|
||||||
assert_throws(new TypeError(), () => new CSSSkew(CSS.deg(0), value));
|
assert_throws_js(TypeError, () => new CSSSkew(CSS.deg(0), value));
|
||||||
}, 'Constructing a CSSSkew with ' + desc + ' throws a TypeError');
|
}, 'Constructing a CSSSkew with ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ for (const attr of ['ax', 'ay']) {
|
|||||||
for (const {value, desc} of gInvalidTestCases) {
|
for (const {value, desc} of gInvalidTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
let skew = new CSSSkew(CSS.deg(0), CSS.deg(0));
|
let skew = new CSSSkew(CSS.deg(0), CSS.deg(0));
|
||||||
assert_throws(new TypeError(), () => skew[attr] = value);
|
assert_throws_js(TypeError, () => skew[attr] = value);
|
||||||
assert_style_value_equals(skew[attr], CSS.deg(0));
|
assert_style_value_equals(skew[attr], CSS.deg(0));
|
||||||
}, 'Updating CSSSkew.' + attr + ' with ' + desc + ' throws a TypeError');
|
}, 'Updating CSSSkew.' + attr + ' with ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,14 @@ const gInvalidTestCases = [
|
|||||||
|
|
||||||
for (const {value, desc} of gInvalidTestCases) {
|
for (const {value, desc} of gInvalidTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSSkewX(value));
|
assert_throws_js(TypeError, () => new CSSSkewX(value));
|
||||||
}, 'Constructing a CSSSkewX with ' + desc + ' throws a TypeError');
|
}, 'Constructing a CSSSkewX with ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const {value, desc} of gInvalidTestCases) {
|
for (const {value, desc} of gInvalidTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
let skewX = new CSSSkewX(CSS.deg(0));
|
let skewX = new CSSSkewX(CSS.deg(0));
|
||||||
assert_throws(new TypeError(), () => skewX.ax = value);
|
assert_throws_js(TypeError, () => skewX.ax = value);
|
||||||
assert_style_value_equals(skewX.ax, CSS.deg(0));
|
assert_style_value_equals(skewX.ax, CSS.deg(0));
|
||||||
}, 'Updating CSSSkewX.ax with ' + desc + ' throws a TypeError');
|
}, 'Updating CSSSkewX.ax with ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
@ -20,14 +20,14 @@ const gInvalidTestCases = [
|
|||||||
|
|
||||||
for (const {value, desc} of gInvalidTestCases) {
|
for (const {value, desc} of gInvalidTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSSkewY(value));
|
assert_throws_js(TypeError, () => new CSSSkewY(value));
|
||||||
}, 'Constructing a CSSSkewY with ' + desc + ' throws a TypeError');
|
}, 'Constructing a CSSSkewY with ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const {value, desc} of gInvalidTestCases) {
|
for (const {value, desc} of gInvalidTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
let skewY = new CSSSkewY(CSS.deg(0));
|
let skewY = new CSSSkewY(CSS.deg(0));
|
||||||
assert_throws(new TypeError(), () => skewY.ay = value);
|
assert_throws_js(TypeError, () => skewY.ay = value);
|
||||||
assert_style_value_equals(skewY.ay, CSS.deg(0));
|
assert_style_value_equals(skewY.ay, CSS.deg(0));
|
||||||
}, 'Updating CSSSkewY.ay with ' + desc + ' throws a TypeError');
|
}, 'Updating CSSSkewY.ay with ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
return new CSSTranslate(
|
return new CSSTranslate(
|
||||||
new CSSUnitValue(1, 'px'),
|
new CSSUnitValue(1, 'px'),
|
||||||
new CSSUnitValue(1, 'em')
|
new CSSUnitValue(1, 'em')
|
||||||
@ -19,7 +19,7 @@ test(() => {
|
|||||||
}, 'CSSTranslate.toMatrix() containing relative units throws TypeError');
|
}, 'CSSTranslate.toMatrix() containing relative units throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
return new CSSPerspective(new CSSUnitValue(1, 'em')).toMatrix();
|
return new CSSPerspective(new CSSUnitValue(1, 'em')).toMatrix();
|
||||||
});
|
});
|
||||||
}, 'CSSPerspective.toMatrix() containing relative units throws TypeError');
|
}, 'CSSPerspective.toMatrix() containing relative units throws TypeError');
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSTransformValue());
|
assert_throws_js(TypeError, () => new CSSTransformValue());
|
||||||
assert_throws(new TypeError(), () => new CSSTransformValue([]));
|
assert_throws_js(TypeError, () => new CSSTransformValue([]));
|
||||||
}, 'Constructing a CSSTransformValue with no components throws TypeError');
|
}, 'Constructing a CSSTransformValue with no components throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
@ -78,7 +78,7 @@ test(() => {
|
|||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
let transform = new CSSTransformValue([new CSSScale(1, 2)]);
|
let transform = new CSSTransformValue([new CSSScale(1, 2)]);
|
||||||
assert_throws(new TypeError(), () => transform.is2D = false);
|
assert_throws_js(TypeError, () => transform.is2D = false);
|
||||||
assert_equals(transform.is2D, true);
|
assert_equals(transform.is2D, true);
|
||||||
}, 'CSSTransformValue.is2D is readonly');
|
}, 'CSSTransformValue.is2D is readonly');
|
||||||
|
|
||||||
|
@ -15,21 +15,21 @@ const gInvalidCoordTestCases = [
|
|||||||
|
|
||||||
for (const {coord, desc} of gInvalidCoordTestCases) {
|
for (const {coord, desc} of gInvalidCoordTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSTranslate(coord, CSS.px(0), CSS.px(0)));
|
assert_throws_js(TypeError, () => new CSSTranslate(coord, CSS.px(0), CSS.px(0)));
|
||||||
assert_throws(new TypeError(), () => new CSSTranslate(CSS.px(0), coord, CSS.px(0)));
|
assert_throws_js(TypeError, () => new CSSTranslate(CSS.px(0), coord, CSS.px(0)));
|
||||||
assert_throws(new TypeError(), () => new CSSTranslate(CSS.px(0), CSS.px(0), coord));
|
assert_throws_js(TypeError, () => new CSSTranslate(CSS.px(0), CSS.px(0), coord));
|
||||||
}, 'Constructing a CSSTranslate with ' + desc + ' for the coordinates throws a TypeError');
|
}, 'Constructing a CSSTranslate with ' + desc + ' for the coordinates throws a TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSTranslate(CSS.px(0), CSS.px(0), CSS.percent(0)));
|
assert_throws_js(TypeError, () => new CSSTranslate(CSS.px(0), CSS.px(0), CSS.percent(0)));
|
||||||
}, 'Constructing a CSSTranslate with a percent for the Z coordinate throws a TypeError');
|
}, 'Constructing a CSSTranslate with a percent for the Z coordinate throws a TypeError');
|
||||||
|
|
||||||
for (const attr of ['x', 'y', 'z']) {
|
for (const attr of ['x', 'y', 'z']) {
|
||||||
for (const {value, desc} of gInvalidCoordTestCases) {
|
for (const {value, desc} of gInvalidCoordTestCases) {
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSTranslate(CSS.px(0), CSS.px(0), CSS.px(0));
|
let result = new CSSTranslate(CSS.px(0), CSS.px(0), CSS.px(0));
|
||||||
assert_throws(new TypeError(), () => result[attr] = value);
|
assert_throws_js(TypeError, () => result[attr] = value);
|
||||||
assert_style_value_equals(result[attr], CSS.px(0));
|
assert_style_value_equals(result[attr], CSS.px(0));
|
||||||
}, 'Updating CSSTranslate.' + attr + ' to ' + desc + ' throws a TypeError');
|
}, 'Updating CSSTranslate.' + attr + ' to ' + desc + ' throws a TypeError');
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ for (const attr of ['x', 'y', 'z']) {
|
|||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSTranslate(CSS.px(0), CSS.px(0), CSS.px(0));
|
let result = new CSSTranslate(CSS.px(0), CSS.px(0), CSS.px(0));
|
||||||
assert_throws(new TypeError(), () => result.z = CSS.percent(0));
|
assert_throws_js(TypeError, () => result.z = CSS.percent(0));
|
||||||
assert_style_value_equals(result.z, CSS.px(0));
|
assert_style_value_equals(result.z, CSS.px(0));
|
||||||
}, 'Updating CSSTranslate.z to a percent throws a TypeError');
|
}, 'Updating CSSTranslate.z to a percent throws a TypeError');
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ test(() => {
|
|||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSUnparsedValue(['foo', 'bar']);
|
let result = new CSSUnparsedValue(['foo', 'bar']);
|
||||||
assert_throws(new RangeError(), () => result[3] = 'foo');
|
assert_throws_js(RangeError, () => result[3] = 'foo');
|
||||||
assert_equals(result[3], undefined, 'fragment does not change');
|
assert_equals(result[3], undefined, 'fragment does not change');
|
||||||
}, 'Setting out of range index in CSSUnparsedValue throws RangeError');
|
}, 'Setting out of range index in CSSUnparsedValue throws RangeError');
|
||||||
|
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSVariableReferenceValue(''));
|
assert_throws_js(TypeError, () => new CSSVariableReferenceValue(''));
|
||||||
}, 'Constructing a CSSVariableReferenceValue with an empty variable name ' +
|
}, 'Constructing a CSSVariableReferenceValue with an empty variable name ' +
|
||||||
'throws a TypeError');
|
'throws a TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSVariableReferenceValue('bar'));
|
assert_throws_js(TypeError, () => new CSSVariableReferenceValue('bar'));
|
||||||
}, 'Constructing a CSSVariableReferenceValue with an invalid variable name ' +
|
}, 'Constructing a CSSVariableReferenceValue with an invalid variable name ' +
|
||||||
'throws SyntaxError');
|
'throws SyntaxError');
|
||||||
|
|
||||||
|
@ -18,14 +18,14 @@ test(() => {
|
|||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSVariableReferenceValue('--foo');
|
let result = new CSSVariableReferenceValue('--foo');
|
||||||
assert_throws(new TypeError(), () => result.variable = '');
|
assert_throws_js(TypeError, () => result.variable = '');
|
||||||
assert_equals(result.variable, '--foo', 'variable does not change');
|
assert_equals(result.variable, '--foo', 'variable does not change');
|
||||||
}, 'Updating CSSVariableReferenceValue.variable to the empty string ' +
|
}, 'Updating CSSVariableReferenceValue.variable to the empty string ' +
|
||||||
'throws TypeError');
|
'throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
let result = new CSSVariableReferenceValue('--foo');
|
let result = new CSSVariableReferenceValue('--foo');
|
||||||
assert_throws(new TypeError(), () => result.variable = 'bar');
|
assert_throws_js(TypeError, () => result.variable = 'bar');
|
||||||
assert_equals(result.variable, '--foo', 'variable does not change');
|
assert_equals(result.variable, '--foo', 'variable does not change');
|
||||||
}, 'Updating CSSVariableReferenceValue.variable to an invalid custom ' +
|
}, 'Updating CSSVariableReferenceValue.variable to an invalid custom ' +
|
||||||
'property name throws TypeError');
|
'property name throws TypeError');
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
test(() => {
|
test(() => {
|
||||||
const a = new CSSUnitValue(0, 'number');
|
const a = new CSSUnitValue(0, 'number');
|
||||||
const b = new CSSUnitValue(0, 'px');
|
const b = new CSSUnitValue(0, 'px');
|
||||||
assert_throws(new TypeError(), () => new CSSMathSum(a, b));
|
assert_throws_js(TypeError, () => new CSSMathSum(a, b));
|
||||||
}, 'Adding two types with different non-null percent hints throws TypeError');
|
}, 'Adding two types with different non-null percent hints throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
@ -40,7 +40,7 @@ test(() => {
|
|||||||
test(() => {
|
test(() => {
|
||||||
const a = new CSSMathProduct(new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'px'));
|
const a = new CSSMathProduct(new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'px'));
|
||||||
const b = new CSSUnitValue(0, 'percent');
|
const b = new CSSUnitValue(0, 'percent');
|
||||||
assert_throws(new TypeError(), () => new CSSMathSum(a, b));
|
assert_throws_js(TypeError, () => new CSSMathSum(a, b));
|
||||||
}, 'Adding a type with percent 2 returns type with percent hint throws TypeError');
|
}, 'Adding a type with percent 2 returns type with percent hint throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
|
@ -62,7 +62,7 @@ for (const {methodName, mathType} of gArithmeticOps) {
|
|||||||
}, 'Calling ' + mathType.name + '.' + methodName + ' with number CSSUnitValues simplifies to a CSSUnitValue');
|
}, 'Calling ' + mathType.name + '.' + methodName + ' with number CSSUnitValues simplifies to a CSSUnitValue');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSS.px(0)[methodName](CSS.px(1), CSS.s(2)));
|
assert_throws_js(TypeError, () => new CSS.px(0)[methodName](CSS.px(1), CSS.s(2)));
|
||||||
}, 'Calling CSSNumericValue.' + methodName + ' with incompatible types throws TypeError');
|
}, 'Calling CSSNumericValue.' + methodName + ' with incompatible types throws TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,9 +145,9 @@ test(() => {
|
|||||||
}, 'Calling CSSNumericValue.div inverts all argument values');
|
}, 'Calling CSSNumericValue.div inverts all argument values');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new RangeError(), () => CSS.number(2).div(CSS.number(0)));
|
assert_throws_js(RangeError, () => CSS.number(2).div(CSS.number(0)));
|
||||||
assert_throws(new RangeError(), () => CSS.number(3).div(CSS.px(10) ,CSS.number(0)));
|
assert_throws_js(RangeError, () => CSS.number(3).div(CSS.px(10) ,CSS.number(0)));
|
||||||
assert_throws(new RangeError(), () => CSS.number(2).div(CSS.number(0), CSS.number(0)));
|
assert_throws_js(RangeError, () => CSS.number(2).div(CSS.number(0), CSS.number(0)));
|
||||||
}, 'Can not divide with CSSUnitValue which has zero value and number type');
|
}, 'Can not divide with CSSUnitValue which has zero value and number type');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSUnitValue(0, 'lemon'));
|
assert_throws_js(TypeError, () => new CSSUnitValue(0, 'lemon'));
|
||||||
}, 'Constructing CSSUnitValue with an unknown unit throws a TypeError');
|
}, 'Constructing CSSUnitValue with an unknown unit throws a TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
assert_throws(new TypeError(), () => new CSSUnitValue(0, ''));
|
assert_throws_js(TypeError, () => new CSSUnitValue(0, ''));
|
||||||
}, 'Constructing CSSUnitValue with a empty string unit throws a TypeError');
|
}, 'Constructing CSSUnitValue with a empty string unit throws a TypeError');
|
||||||
|
|
||||||
for (const unit of gValidUnits) {
|
for (const unit of gValidUnits) {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
test(() => {
|
test(() => {
|
||||||
const a = new CSSMathSum(new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'percent'));
|
const a = new CSSMathSum(new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'percent'));
|
||||||
const b = new CSSMathSum(new CSSUnitValue(0, 's'), new CSSUnitValue(0, 'percent'));
|
const b = new CSSMathSum(new CSSUnitValue(0, 's'), new CSSUnitValue(0, 'percent'));
|
||||||
assert_throws(new TypeError(), () => new CSSMathProduct(a, b));
|
assert_throws_js(TypeError, () => new CSSMathProduct(a, b));
|
||||||
}, 'Multiplying two types with different non-null percent hints throws TypeError');
|
}, 'Multiplying two types with different non-null percent hints throws TypeError');
|
||||||
|
|
||||||
test(() => {
|
test(() => {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createComputedStyleMap(t);
|
const styleMap = createComputedStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.get('lemon'));
|
assert_throws_js(TypeError, () => styleMap.get('lemon'));
|
||||||
}, 'Calling StylePropertyMap.get with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.get with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createComputedStyleMap(t);
|
const styleMap = createComputedStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.getAll('lemon'));
|
assert_throws_js(TypeError, () => styleMap.getAll('lemon'));
|
||||||
}, 'Calling StylePropertyMap.getAll with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.getAll with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createComputedStyleMap(t);
|
const styleMap = createComputedStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.has('lemon'));
|
assert_throws_js(TypeError, () => styleMap.has('lemon'));
|
||||||
}, 'Calling StylePropertyMap.has with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.has with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
const gTestCases = [
|
const gTestCases = [
|
||||||
|
@ -24,7 +24,7 @@ const gInvalidTestCases = [
|
|||||||
for (const {property, values, desc} of gInvalidTestCases) {
|
for (const {property, values, desc} of gInvalidTestCases) {
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createDeclaredStyleMap(t, '');
|
let styleMap = createDeclaredStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.append(property, ...values));
|
assert_throws_js(TypeError, () => styleMap.append(property, ...values));
|
||||||
}, 'Calling StylePropertyMap.append with ' + desc + ' throws TypeError');
|
}, 'Calling StylePropertyMap.append with ' + desc + ' throws TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createDeclaredStyleMap(t, '');
|
let styleMap = createDeclaredStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.delete('lemon'));
|
assert_throws_js(TypeError, () => styleMap.delete('lemon'));
|
||||||
}, 'Deleting an unsupported property name throws a TypeError');
|
}, 'Deleting an unsupported property name throws a TypeError');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createDeclaredStyleMap(t);
|
const styleMap = createDeclaredStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.get('lemon'));
|
assert_throws_js(TypeError, () => styleMap.get('lemon'));
|
||||||
}, 'Calling StylePropertyMap.get with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.get with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createDeclaredStyleMap(t);
|
const styleMap = createDeclaredStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.getAll('lemon'));
|
assert_throws_js(TypeError, () => styleMap.getAll('lemon'));
|
||||||
}, 'Calling StylePropertyMap.getAll with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.getAll with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createDeclaredStyleMap(t);
|
const styleMap = createDeclaredStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.has('lemon'));
|
assert_throws_js(TypeError, () => styleMap.has('lemon'));
|
||||||
}, 'Calling StylePropertyMap.has with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.has with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
const gTestCases = [
|
const gTestCases = [
|
||||||
|
@ -17,7 +17,7 @@ const gInvalidTestCases = [
|
|||||||
for (const {property, values, desc} of gInvalidTestCases) {
|
for (const {property, values, desc} of gInvalidTestCases) {
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.set(property, ...values));
|
assert_throws_js(TypeError, () => styleMap.set(property, ...values));
|
||||||
}, 'Setting a shorthand with ' + desc + ' on css rule throws TypeError');
|
}, 'Setting a shorthand with ' + desc + ' on css rule throws TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,23 +19,23 @@ const gInvalidTestCases = [
|
|||||||
for (const {property, values, desc} of gInvalidTestCases) {
|
for (const {property, values, desc} of gInvalidTestCases) {
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createDeclaredStyleMap(t, '');
|
let styleMap = createDeclaredStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.set(property, ...values));
|
assert_throws_js(TypeError, () => styleMap.set(property, ...values));
|
||||||
}, 'Setting a StylePropertyMap with ' + desc + ' throws TypeError');
|
}, 'Setting a StylePropertyMap with ' + desc + ' throws TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createDeclaredStyleMap(t, '');
|
let styleMap = createDeclaredStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.set('width', CSS.px(10), CSS.px(10)));
|
assert_throws_js(TypeError, () => styleMap.set('width', CSS.px(10), CSS.px(10)));
|
||||||
}, 'Setting a non list-valued property with multiple arguments throws TypeError');
|
}, 'Setting a non list-valued property with multiple arguments throws TypeError');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createDeclaredStyleMap(t, '');
|
let styleMap = createDeclaredStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.set('width', '1s, 2s'));
|
assert_throws_js(TypeError, () => styleMap.set('width', '1s, 2s'));
|
||||||
}, 'Setting a non list-valued property with list-valued string throws TypeError');
|
}, 'Setting a non list-valued property with list-valued string throws TypeError');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createDeclaredStyleMap(t, '');
|
let styleMap = createDeclaredStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
styleMap.set('transition-duration', '1s', new CSSUnparsedValue([]));
|
styleMap.set('transition-duration', '1s', new CSSUnparsedValue([]));
|
||||||
});
|
});
|
||||||
}, 'Setting a list-valued property with a CSSUnparsedValue and other ' +
|
}, 'Setting a list-valued property with a CSSUnparsedValue and other ' +
|
||||||
@ -43,7 +43,7 @@ test(t => {
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createDeclaredStyleMap(t, '');
|
let styleMap = createDeclaredStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
styleMap.set('transition-duration', '1s', 'var(--A)');
|
styleMap.set('transition-duration', '1s', 'var(--A)');
|
||||||
});
|
});
|
||||||
}, 'Setting a list-valued property with a var ref() and other values ' +
|
}, 'Setting a list-valued property with a var ref() and other values ' +
|
||||||
|
@ -24,7 +24,7 @@ const gInvalidTestCases = [
|
|||||||
for (const {property, values, desc} of gInvalidTestCases) {
|
for (const {property, values, desc} of gInvalidTestCases) {
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.append(property, ...values));
|
assert_throws_js(TypeError, () => styleMap.append(property, ...values));
|
||||||
}, 'Calling StylePropertyMap.append with ' + desc + ' throws TypeError');
|
}, 'Calling StylePropertyMap.append with ' + desc + ' throws TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.delete('lemon'));
|
assert_throws_js(TypeError, () => styleMap.delete('lemon'));
|
||||||
}, 'Deleting an unsupported property name throws a TypeError');
|
}, 'Deleting an unsupported property name throws a TypeError');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createInlineStyleMap(t);
|
const styleMap = createInlineStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.get('lemon'));
|
assert_throws_js(TypeError, () => styleMap.get('lemon'));
|
||||||
}, 'Calling StylePropertyMap.get with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.get with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createInlineStyleMap(t);
|
const styleMap = createInlineStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.getAll('lemon'));
|
assert_throws_js(TypeError, () => styleMap.getAll('lemon'));
|
||||||
}, 'Calling StylePropertyMap.getAll with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.getAll with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
const styleMap = createInlineStyleMap(t);
|
const styleMap = createInlineStyleMap(t);
|
||||||
assert_throws(new TypeError(), () => styleMap.has('lemon'));
|
assert_throws_js(TypeError, () => styleMap.has('lemon'));
|
||||||
}, 'Calling StylePropertyMap.has with an unsupported property throws a TypeError');
|
}, 'Calling StylePropertyMap.has with an unsupported property throws a TypeError');
|
||||||
|
|
||||||
const gTestCases = [
|
const gTestCases = [
|
||||||
|
@ -17,7 +17,7 @@ const gInvalidTestCases = [
|
|||||||
for (const {property, values, desc} of gInvalidTestCases) {
|
for (const {property, values, desc} of gInvalidTestCases) {
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.set(property, ...values));
|
assert_throws_js(TypeError, () => styleMap.set(property, ...values));
|
||||||
}, 'Setting a shorthand with ' + desc + ' on inline style throws TypeError');
|
}, 'Setting a shorthand with ' + desc + ' on inline style throws TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,23 +19,23 @@ const gInvalidTestCases = [
|
|||||||
for (const {property, values, desc} of gInvalidTestCases) {
|
for (const {property, values, desc} of gInvalidTestCases) {
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.set(property, ...values));
|
assert_throws_js(TypeError, () => styleMap.set(property, ...values));
|
||||||
}, 'Setting a StylePropertyMap with ' + desc + ' throws TypeError');
|
}, 'Setting a StylePropertyMap with ' + desc + ' throws TypeError');
|
||||||
}
|
}
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.set('width', CSS.px(10), CSS.px(10)));
|
assert_throws_js(TypeError, () => styleMap.set('width', CSS.px(10), CSS.px(10)));
|
||||||
}, 'Setting a non list-valued property with multiple arguments throws TypeError');
|
}, 'Setting a non list-valued property with multiple arguments throws TypeError');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => styleMap.set('width', '1s, 2s'));
|
assert_throws_js(TypeError, () => styleMap.set('width', '1s, 2s'));
|
||||||
}, 'Setting a non list-valued property with list-valued string throws TypeError');
|
}, 'Setting a non list-valued property with list-valued string throws TypeError');
|
||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
styleMap.set('transition-duration', '1s', new CSSUnparsedValue([]));
|
styleMap.set('transition-duration', '1s', new CSSUnparsedValue([]));
|
||||||
});
|
});
|
||||||
}, 'Setting a list-valued property with a CSSUnparsedValue and other ' +
|
}, 'Setting a list-valued property with a CSSUnparsedValue and other ' +
|
||||||
@ -43,7 +43,7 @@ test(t => {
|
|||||||
|
|
||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t, '');
|
let styleMap = createInlineStyleMap(t, '');
|
||||||
assert_throws(new TypeError(), () => {
|
assert_throws_js(TypeError, () => {
|
||||||
styleMap.set('transition-duration', '1s', 'var(--A)');
|
styleMap.set('transition-duration', '1s', 'var(--A)');
|
||||||
});
|
});
|
||||||
}, 'Setting a list-valued property with a var ref() and other values ' +
|
}, 'Setting a list-valued property with a var ref() and other values ' +
|
||||||
|
@ -357,7 +357,7 @@ function testPropertyInvalid(propertyName, examples, description) {
|
|||||||
test(t => {
|
test(t => {
|
||||||
let styleMap = createInlineStyleMap(t);
|
let styleMap = createInlineStyleMap(t);
|
||||||
for (const example of examples) {
|
for (const example of examples) {
|
||||||
assert_throws(new TypeError(), () => styleMap.set(propertyName, example.input));
|
assert_throws_js(TypeError, () => styleMap.set(propertyName, example.input));
|
||||||
}
|
}
|
||||||
}, `Setting '${propertyName}' to ${description} throws TypeError`);
|
}, `Setting '${propertyName}' to ${description} throws TypeError`);
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@ document.elementsFromPoint() are mandatory and of type double.</title>
|
|||||||
<script>
|
<script>
|
||||||
function validate_function_parameter_count(testFunc, funcName) {
|
function validate_function_parameter_count(testFunc, funcName) {
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
testFunc();
|
testFunc();
|
||||||
}, "Called with no parameter");
|
}, "Called with no parameter");
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
testFunc(0);
|
testFunc(0);
|
||||||
}, "Called with 1 parameter");
|
}, "Called with 1 parameter");
|
||||||
}, funcName + ": Parameters are mandatory.");
|
}, funcName + ": Parameters are mandatory.");
|
||||||
@ -18,16 +18,16 @@ function validate_function_parameter_count(testFunc, funcName) {
|
|||||||
|
|
||||||
function validate_function_parameter_type(testFunc, funcName) {
|
function validate_function_parameter_type(testFunc, funcName) {
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
testFunc(0, Infinity);
|
testFunc(0, Infinity);
|
||||||
}, "Passing Infinity as second parameter throws");
|
}, "Passing Infinity as second parameter throws");
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
testFunc(Infinity, 0);
|
testFunc(Infinity, 0);
|
||||||
}, "Passing Infinity as first parameter throws");
|
}, "Passing Infinity as first parameter throws");
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
testFunc(0, NaN);
|
testFunc(0, NaN);
|
||||||
}, "Passing NaN as second parameter throws");
|
}, "Passing NaN as second parameter throws");
|
||||||
assert_throws(new TypeError(), function() {
|
assert_throws_js(TypeError, function() {
|
||||||
testFunc(NaN, 0);
|
testFunc(NaN, 0);
|
||||||
}, "Passing NaN as first parameter throws");
|
}, "Passing NaN as first parameter throws");
|
||||||
}, funcName + ": Parameters should be finite floating point values.");
|
}, funcName + ": Parameters should be finite floating point values.");
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<script>
|
<script>
|
||||||
test(function() {
|
test(function() {
|
||||||
assert_equals(CSS.escape.length, 1);
|
assert_equals(CSS.escape.length, 1);
|
||||||
assert_throws(new TypeError(), function() { CSS.escape(); });
|
assert_throws_js(TypeError, function() { CSS.escape(); });
|
||||||
}, "Number of arguments");
|
}, "Number of arguments");
|
||||||
|
|
||||||
test(function() {
|
test(function() {
|
||||||
|
@ -138,7 +138,7 @@ test(function() {
|
|||||||
}, "Dynamically change to display: contents on pseudo-elements");
|
}, "Dynamically change to display: contents on pseudo-elements");
|
||||||
test(function() {
|
test(function() {
|
||||||
var div = document.getElementById('test');
|
var div = document.getElementById('test');
|
||||||
assert_throws(new TypeError(), () => getComputedStyle(div, "totallynotapseudo"),
|
assert_throws_js(TypeError, () => getComputedStyle(div, "totallynotapseudo"),
|
||||||
"getComputedStyle with an unknown pseudo-element throws");
|
"getComputedStyle with an unknown pseudo-element throws");
|
||||||
}, "Unknown pseudo-elements throw");
|
}, "Unknown pseudo-elements throw");
|
||||||
</script>
|
</script>
|
||||||
|
@ -57,15 +57,15 @@ test(function() {
|
|||||||
assert_equals(element.mode.baseVal, SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN);
|
assert_equals(element.mode.baseVal, SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN);
|
||||||
assert_equals(element.getAttribute('mode'), "lighten");
|
assert_equals(element.getAttribute('mode'), "lighten");
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { element.mode.baseVal = 17; });
|
assert_throws_js(TypeError, function() { element.mode.baseVal = 17; });
|
||||||
assert_equals(element.mode.baseVal, SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN);
|
assert_equals(element.mode.baseVal, SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN);
|
||||||
assert_equals(element.getAttribute('mode'), "lighten");
|
assert_equals(element.getAttribute('mode'), "lighten");
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { element.mode.baseVal = -1; });
|
assert_throws_js(TypeError, function() { element.mode.baseVal = -1; });
|
||||||
assert_equals(element.mode.baseVal, SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN);
|
assert_equals(element.mode.baseVal, SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN);
|
||||||
assert_equals(element.getAttribute('mode'), "lighten");
|
assert_equals(element.getAttribute('mode'), "lighten");
|
||||||
|
|
||||||
assert_throws(new TypeError(), function() { element.mode.baseVal = 0; });
|
assert_throws_js(TypeError, function() { element.mode.baseVal = 0; });
|
||||||
assert_equals(element.mode.baseVal, SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN);
|
assert_equals(element.mode.baseVal, SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN);
|
||||||
assert_equals(element.getAttribute('mode'), "lighten");
|
assert_equals(element.getAttribute('mode'), "lighten");
|
||||||
}, document.title + ", setter, invalid value");
|
}, document.title + ", setter, invalid value");
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user