Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: LayoutTests/fast/canvas/canvas-ImageData-behaviour.js

Issue 662873002: Manual rebaseline of fast/canvas/canvas-ImageData-behaviour.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description("Series of tests to ensure correct behaviour of the ImageData object "); 1 description("Series of tests to ensure correct behaviour of the ImageData object ");
2 2
3 imageData = document.getElementById("canvas").getContext("2d").getImageData(0,0, 2,2); 3 imageData = document.getElementById("canvas").getContext("2d").getImageData(0,0, 2,2);
4 4
5 shouldBe("imageData.width", "2"); 5 shouldBe("imageData.width", "2");
6 shouldBe("imageData.height", "2"); 6 shouldBe("imageData.height", "2");
7 shouldBe("imageData.data.length", "16"); 7 shouldBe("imageData.data.length", "16");
8 for (var i = 0; i < imageData.data.length; i++) 8 for (var i = 0; i < imageData.data.length; i++)
9 shouldBe("imageData.data["+i+"]", "0"); 9 shouldBe("imageData.data["+i+"]", "0");
10 10
11 var testValues = [NaN, true, false, "\"garbage\"", "-1", 11 var testValues = [NaN, true, false, "\"garbage\"", "-1",
12 "\"0\"", "\"1\"", "\"2\"", Infinity, -Infinity, 12 "\"0\"", "\"1\"", "\"2\"", Infinity, -Infinity,
13 -5, -0.5, 0, 0.5, 5, 13 -5, -0.5, 0, 0.5, 5,
14 5.4, 255, 256, null, undefined]; 14 5.4, 255, 256, null, undefined];
15 var testResults = [0, 1, 0, 0, 0, 15 var testResults = [0, 1, 0, 0, 0,
16 0, 1, 2, 255, 0, 16 0, 1, 2, 255, 0,
17 0, 0, 0, 0, 5, 17 0, 0, 0, 0, 5,
18 5, 255, 255, 0, 0]; 18 5, 255, 255, 0, 0];
19 for (var i = 0; i < testValues.length; i++) { 19 for (var i = 0; i < testValues.length; i++) {
20 shouldBe("imageData.data[0] = "+testValues[i]+", imageData.data[0]", ""+test Results[i]); 20 shouldBe("imageData.data[0] = "+testValues[i]+", imageData.data[0]", ""+test Results[i]);
21 } 21 }
22 22
23 shouldBe("imageData.data['foo']='garbage',imageData.data['foo']", "'garbage'"); 23 shouldBe("imageData.data['foo']='garbage',imageData.data['foo']", "'garbage'");
24 shouldBe("imageData.data[-1]='garbage',imageData.data[-1]", "'garbage'"); 24 shouldBe("imageData.data[-1]='garbage',imageData.data[-1]", "undefined");
25 shouldBe("imageData.data[17]='garbage',imageData.data[17]", "undefined"); 25 shouldBe("imageData.data[17]='garbage',imageData.data[17]", "undefined");
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/canvas/canvas-ImageData-behaviour-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698