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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-arc-connecting-line.js

Issue 2670353002: 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("Test that canvas arc()s are connected by a straight line. There sho uld be two C-shapes with a line from the bottom of the left one to the top of th e right one.");
2
3 var canvas = document.createElement('canvas');
4 document.body.appendChild(canvas)
5 canvas.setAttribute('width', '300');
6 canvas.setAttribute('height', '300');
7 var ctx = canvas.getContext('2d');
8 ctx.fillStyle = '#0f0';
9 ctx.fillRect(0, 0, canvas.width, canvas.height);
10 ctx.lineJoin = 'bevel';
11 ctx.lineWidth = 12;
12 ctx.beginPath();
13 ctx.arc(200, 50, 40, Math.PI / 2, -Math.PI / 2, false);
14 ctx.arc(100, 50, 40, Math.PI / 2, -Math.PI / 2, false);
15 ctx.stroke();
16
17 var imageData = ctx.getImageData(0, 0, 1, 1);
18 var imgdata = imageData.data;
19 shouldBe("imgdata[0]", "0");
20 shouldBe("imgdata[1]", "255");
21 shouldBe("imgdata[2]", "0");
22
23 imageData = ctx.getImageData(125, 30, 1, 1);
24 imgdata = imageData.data;
25 shouldBe("imgdata[0]", "0");
26 shouldBe("imgdata[1]", "255");
27 shouldBe("imgdata[2]", "0");
28
29 imageData = ctx.getImageData(125, 70, 1, 1);
30 imgdata = imageData.data;
31 shouldBe("imgdata[0]", "0");
32 shouldBe("imgdata[1]", "0");
33 shouldBe("imgdata[2]", "0");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698