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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-fillRect.js

Issue 2678493002: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Addressing comments Created 3 years, 10 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
OLDNEW
(Empty)
1 description("Series of tests to ensure correct behavior of canvas.fillRect().");
2 var ctx = document.createElement('canvas').getContext('2d');
3
4 // Fill rect with height = width = 0.
5 debug("Test canvas.fillRect() with height = width = 0.");
6 ctx.fillStyle = 'red';
7 ctx.fillRect(0, 0, 0, 0);
8
9 var imageData = ctx.getImageData(0, 0, 1, 1);
10 var imgdata = imageData.data;
11 shouldBe("imgdata[0]", "0");
12 shouldBe("imgdata[1]", "0");
13 shouldBe("imgdata[2]", "0");
14
15 ctx.clearRect(0, 0, 1, 1);
16
17 // Fill rect with height = 0, width = 1.
18 debug("Test canvas.fillRect() with height = 0, width = 1.");
19 ctx.fillStyle = 'red';
20 ctx.fillRect(0, 0, 1, 0);
21
22 var imageData = ctx.getImageData(0, 0, 1, 1);
23 var imgdata = imageData.data;
24 shouldBe("imgdata[0]", "0");
25 shouldBe("imgdata[1]", "0");
26 shouldBe("imgdata[2]", "0");
27
28 ctx.clearRect(0, 0, 1, 1);
29
30 // Fill rect with height = 1, width = 0.
31 debug("Test canvas.fillRect() with height = 1, width = 0.");
32 ctx.fillStyle = 'red';
33 ctx.fillRect(0, 0, 0, 1);
34
35 var imageData = ctx.getImageData(0, 0, 1, 1);
36 var imgdata = imageData.data;
37 shouldBe("imgdata[0]", "0");
38 shouldBe("imgdata[1]", "0");
39 shouldBe("imgdata[2]", "0");
40
41 ctx.clearRect(0, 0, 1, 1);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698