blob: 13a0b7c88926650439c533a84b9df30aa66e30a5 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Test the behavior of CanvasRenderingContext2D.setShadow() when called with different numbers of arguments.");
var ctx = document.createElement('canvas').getContext('2d');
var TypeError = "TypeError: Type error";
var TypeErrorNotEnoughArguments = "TypeError: Not enough arguments";
shouldThrow("ctx.setShadow()", "TypeErrorNotEnoughArguments");
shouldThrow("ctx.setShadow(0)", "TypeErrorNotEnoughArguments");
shouldThrow("ctx.setShadow(0, 0)", "TypeErrorNotEnoughArguments");
shouldBe("ctx.setShadow(0, 0, 0)", "undefined");
shouldBe("ctx.setShadow(0, 0, 0, 0)", "undefined");
shouldBe("ctx.setShadow(0, 0, 0, 0, 0)", "undefined");
shouldThrow("ctx.setShadow(0, 0, 0, 0, 0, 0)", "TypeError");
shouldBe("ctx.setShadow(0, 0, 0, 0, 'red')", "undefined");
shouldThrow("ctx.setShadow(0, 0, 0, 0, 'red', 0)", "TypeError");
shouldBe("ctx.setShadow(0, 0, 0, 0, 'red', 0, 0)", "undefined");
shouldThrow("ctx.setShadow(0, 0, 0, 0, 0, 0)", "TypeError");
shouldBe("ctx.setShadow(0, 0, 0, 0, 0, 0, 0)", "undefined");
shouldBe("ctx.setShadow(0, 0, 0, 0, 0, 0, 0, 0)", "undefined");
shouldBe("ctx.setShadow(0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>