summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-getImageData-invalid.js
blob: f29db675f7b255677e11fd0c5cf363a757c08563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
description("Test the handling of invalid arguments in canvas getImageData().");

ctx = document.createElement('canvas').getContext('2d');

shouldThrow("ctx.getImageData(NaN, 10, 10, 10)");
shouldThrow("ctx.getImageData(10, NaN, 10, 10)");
shouldThrow("ctx.getImageData(10, 10, NaN, 10)");
shouldThrow("ctx.getImageData(10, 10, 10, NaN)");
shouldThrow("ctx.getImageData(Infinity, 10, 10, 10)");
shouldThrow("ctx.getImageData(10, Infinity, 10, 10)");
shouldThrow("ctx.getImageData(10, 10, Infinity, 10)");
shouldThrow("ctx.getImageData(10, 10, 10, Infinity)");
shouldThrow("ctx.getImageData(undefined, 10, 10, 10)");
shouldThrow("ctx.getImageData(10, undefined, 10, 10)");
shouldThrow("ctx.getImageData(10, 10, undefined, 10)");
shouldThrow("ctx.getImageData(10, 10, 10, undefined)");
shouldThrow("ctx.getImageData(10, 10, 0, 10)");
shouldThrow("ctx.getImageData(10, 10, 10, 0)");