Test case details

Preparation Code

<script language="JavaScript">   var canvas = document.createElement('canvas');   canvas.width = 100;   canvas.height = 100;   var context = canvas.getContext('2d');   context.fillStyle = '#abc';   context.fillRect(0, 0, 100, 100); </script>

Test cases

Test #1

var data = context.getImageData(0, 0, 1, 1); console.log(data)

Test #2

var data = context.getImageData(50, 50, 1, 1);

Test #3

var data = context.getImageData(0, 0, 10, 10);

Test #4

var data = context.getImageData(0, 0, 30, 30);

Test #5

var data = context.getImageData(0, 0, 90, 1);

Test #6

var data = context.getImageData(0, 0, 1, 90);

Test #7

var data = context.getImageData(0, 0, 100, 100);

Test #8

var data = context.getImageData(0, 0, 1, 100);

Test #9

var data = context.getImageData(0, 0, 1, 100); data = context.getImageData(0, 99, 1, 100); data = context.getImageData(0, 1, 98, 1); data = context.getImageData(99, 1, 1, 98);

Test #10

var data = context.getImageData(0, 0, 1, 30); data = context.getImageData(0, 29, 1, 30); data = context.getImageData(0, 1, 28, 1); data = context.getImageData(29, 1, 1, 28);

Test #11

var data = context.getImageData(0, 0, 1, 100); data = context.getImageData(0, 99, 1, 100); data = context.getImageData(0, 1, 98, 1); data = context.getImageData(99, 1, 1, 98);

Test #12

var data = context.getImageData(0, 0, 1, 1);

Test #13

var data = context.getImageData(0, 0, 1, 1); data = context.getImageData(1, 1, 1, 1); data = context.getImageData(2, 2, 1, 1); data = context.getImageData(3, 3, 1, 1); data = context.getImageData(4, 4, 1, 1);