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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-360-winding.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-360-winding.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-360-winding.html
index ca55e616f795ba0db53857d26a91dfc2573e59c9..43c28e1fb813e7adae6d2b22879c6a33ff9c4368 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-360-winding.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-360-winding.html
@@ -1,9 +1,43 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script src="script-tests/canvas-arc-360-winding.js"></script>
-</body>
-</html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<script>
+test(function(t) {
+ var canvas = document.createElement('canvas');
+ canvas.width = 300;
+ canvas.height = 150;
+ var ctx = canvas.getContext('2d');
+
+ var r;
+ var anticlockwise = true;
+ ctx.beginPath();
+ for (r = 200; r >= 10; r -= 10) {
+ ctx.moveTo(150 + r, 75);
+ ctx.arc(150, 75, r, 0, Math.PI*2, anticlockwise);
+ ctx.closePath();
+ anticlockwise = !anticlockwise;
+ }
+ ctx.fillStyle = 'rgba(0, 255, 0, 1)';
+ ctx.strokeStyle = 'rgba(0, 255, 0, 1)';
+ ctx.fill();
+ ctx.stroke();
+
+ var imageData = ctx.getImageData(297, 75, 1, 1);
+ var data = imageData.data;
+ assert_equals(data[0], 0);
+ assert_equals(data[1], 0);
+ assert_equals(data[2], 0);
+
+ imageData = ctx.getImageData(285, 5, 1, 1);
+ data = imageData.data;
+ assert_equals(data[0], 0);
+ assert_equals(data[1], 255);
+ assert_equals(data[2], 0);
+
+ imageData = ctx.getImageData(277, 75, 1, 1);
+ data = imageData.data;
+ assert_equals(data[0], 0);
+ assert_equals(data[1], 0);
+ assert_equals(data[2], 0);
+}, 'This tests canvas full arc fill with nonzero winding rule. Eight green concentric thick circumferences should be displayed.');
+</script>
« 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