blob: 938c796a93859801857a968f0e73713d19200c63 [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 handling of invalid arguments in canvas getImageData().");
ctx = document.createElement('canvas').getContext('2d');
shouldThrow("ctx.getImageData(NaN, 10, 10, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, NaN, 10, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, 10, NaN, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, 10, 10, NaN)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(Infinity, 10, 10, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, Infinity, 10, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, 10, Infinity, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, 10, 10, Infinity)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(undefined, 10, 10, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, undefined, 10, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, 10, undefined, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, 10, 10, undefined)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.getImageData(10, 10, 0, 10)", '"IndexSizeError: The index is not in the allowed range."');
shouldThrow("ctx.getImageData(10, 10, 10, 0)", '"IndexSizeError: The index is not in the allowed range."');
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>