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

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

Issue 2675763005: 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.clearRect().") ;
2 var ctx = document.createElement('canvas').getContext('2d');
3
4 // Clear rect with height = width = 0.
5 debug("Test canvas.clearRect() with height = width = 0.");
6 ctx.fillStyle = 'red';
7 ctx.fillRect(0, 0, 1, 1);
8 ctx.clearRect(0, 0, 0, 0);
9
10 var imageData = ctx.getImageData(0, 0, 1, 1);
11 var imgdata = imageData.data;
12 shouldBe("imgdata[0]", "255");
13 shouldBe("imgdata[1]", "0");
14 shouldBe("imgdata[2]", "0");
15
16 ctx.clearRect(0, 0, 1, 1);
17
18 // Clear rect with height = 0, width = 1.
19 debug("Test canvas.clearRect() with height = 0, width = 1.");
20 ctx.fillStyle = 'red';
21 ctx.fillRect(0, 0, 1, 1);
22 ctx.clearRect(0, 0, 1, 0);
23
24 var imageData = ctx.getImageData(0, 0, 1, 1);
25 var imgdata = imageData.data;
26 shouldBe("imgdata[0]", "255");
27 shouldBe("imgdata[1]", "0");
28 shouldBe("imgdata[2]", "0");
29
30 ctx.clearRect(0, 0, 1, 1);
31
32 // Clear rect with height = 1, width = 0.
33 debug("Test canvas.clearRect() with height = 1, width = 0.");
34 ctx.fillStyle = 'red';
35 ctx.fillRect(0, 0, 1, 1);
36 ctx.clearRect(0, 0, 0, 1);
37
38 var imageData = ctx.getImageData(0, 0, 1, 1);
39 var imgdata = imageData.data;
40 shouldBe("imgdata[0]", "255");
41 shouldBe("imgdata[1]", "0");
42 shouldBe("imgdata[2]", "0");
43
44 ctx.clearRect(0, 0, 1, 1);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698