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

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

Issue 2694703004: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-path-addpath.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 description("Test different constructors of Path.");
2 var ctx = document.createElement('canvas').getContext('2d');
3
4 debug("Test constructor Path().")
5 ctx.beginPath();
6 var p1 = new Path2D();
7 p1.rect(0,0,100,100);
8 ctx.fillStyle = 'yellow';
9 ctx.fill(p1);
10 var imageData = ctx.getImageData(0, 0, 100, 100);
11 var imgdata = imageData.data;
12 shouldBe("imgdata[4]", "255");
13 shouldBe("imgdata[5]", "255");
14 shouldBe("imgdata[6]", "0");
15 shouldBe("imgdata[7]", "255");
16 debug("");
17
18 debug("Test constructor Path(DOMString) which takes a SVG data string.")
19 ctx.beginPath();
20 var p2 = new Path2D("M100,0L200,0L200,100L100,100z");
21 ctx.fillStyle = 'blue';
22 ctx.fill(p2);
23 imageData = ctx.getImageData(100, 0, 100, 100);
24 imgdata = imageData.data;
25 shouldBe("imgdata[4]", "0");
26 shouldBe("imgdata[5]", "0");
27 shouldBe("imgdata[6]", "255");
28 shouldBe("imgdata[7]", "255");
29 debug("");
30
31 debug("Test constructor Path(Path) which takes another Path object.")
32 ctx.beginPath();
33 var p3 = new Path2D(p1);
34 ctx.translate(200,0);
35 ctx.fillStyle = 'green';
36 ctx.fill(p3);
37 ctx.translate(-200,0);
38 imageData = ctx.getImageData(200, 0, 100, 100);
39 imgdata = imageData.data;
40 shouldBe("imgdata[4]", "0");
41 shouldBe("imgdata[5]", "128");
42 shouldBe("imgdata[6]", "0");
43 shouldBe("imgdata[7]", "255");
44 debug("");
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-path-addpath.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698