blob: 3ad340fd7b26eeb1e4f50d1d9ea9c3afaaa7f066 [file] [log] [blame]
description("Test the argument bounds of canvas createImageData.");
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
shouldThrow("ctx.createImageData(Infinity, Infinity)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.createImageData(Infinity, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.createImageData(-Infinity, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.createImageData(10, Infinity)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.createImageData(10, -Infinity)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.createImageData(NaN, 10)", '"TypeError: The provided value is non-finite"');
shouldThrow("ctx.createImageData(10, NaN)", '"TypeError: The provided value is non-finite"');