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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-360-winding.html

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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-360-winding-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <script src="../../resources/testharness.js"></script>
2 <html> 2 <script src="../../resources/testharnessreport.js"></script>
3 <head> 3
4 <script src="../../resources/js-test.js"></script> 4 <script>
5 </head> 5 test(function(t) {
6 <body> 6 var canvas = document.createElement('canvas');
7 <script src="script-tests/canvas-arc-360-winding.js"></script> 7 canvas.width = 300;
8 </body> 8 canvas.height = 150;
9 </html> 9 var ctx = canvas.getContext('2d');
10
11 var r;
12 var anticlockwise = true;
13 ctx.beginPath();
14 for (r = 200; r >= 10; r -= 10) {
15 ctx.moveTo(150 + r, 75);
16 ctx.arc(150, 75, r, 0, Math.PI*2, anticlockwise);
17 ctx.closePath();
18 anticlockwise = !anticlockwise;
19 }
20 ctx.fillStyle = 'rgba(0, 255, 0, 1)';
21 ctx.strokeStyle = 'rgba(0, 255, 0, 1)';
22 ctx.fill();
23 ctx.stroke();
24
25 var imageData = ctx.getImageData(297, 75, 1, 1);
26 var data = imageData.data;
27 assert_equals(data[0], 0);
28 assert_equals(data[1], 0);
29 assert_equals(data[2], 0);
30
31 imageData = ctx.getImageData(285, 5, 1, 1);
32 data = imageData.data;
33 assert_equals(data[0], 0);
34 assert_equals(data[1], 255);
35 assert_equals(data[2], 0);
36
37 imageData = ctx.getImageData(277, 75, 1, 1);
38 data = imageData.data;
39 assert_equals(data[0], 0);
40 assert_equals(data[1], 0);
41 assert_equals(data[2], 0);
42 }, 'This tests canvas full arc fill with nonzero winding rule. Eight green conce ntric thick circumferences should be displayed.');
43 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-360-winding-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698