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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-zero-lineto.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
Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-zero-lineto.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-zero-lineto.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-zero-lineto.html
index 8e471739d5a046a55fd26d8b1b5943bc73dbca14..bf00fbf30a9a8db624d904dc5b018beedcc7e56e 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-zero-lineto.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-zero-lineto.html
@@ -1,53 +1,47 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<canvas id="canvas" width="100" height="100"></canvas>
-<script>
-description("Bug 55696: Series of tests to ensure zero-length arc extends current subpath");
-var ctx = document.getElementById('canvas').getContext('2d');
-ctx.lineWidth = 4;
-function shouldBeBlackPixel(x,y)
+<script>
+function shouldBeBlackPixel(ctx, x, y)
{
var data = ctx.getImageData(x, y, 1, 1).data;
- if (data[0] != 0 || data[1] != 0 || data[2] != 0 || data[3] != 255) {
- testFailed("Pixel (" + x + "," + y + ") should be black; " +
- "was [" + data[0] + "," + data[1] + "," + data[2] + "," + data[3] + "]");
- } else {
- testPassed("Pixel (" + x + "," + y + ") is black.");
- }
+ assert_equals(data[0], 0);
+ assert_equals(data[1], 0);
+ assert_equals(data[2], 0);
+ assert_equals(data[3], 255);
}
-// moveTo + empty arc (swing == 0)
-ctx.beginPath();
-ctx.moveTo(20, 20);
-ctx.arc(80, 30, 10, -Math.PI/2, -Math.PI/2, true);
-ctx.stroke();
-shouldBeBlackPixel(50, 20);
-
-// moveTo + empty arc (radius == 0)
-ctx.beginPath();
-ctx.moveTo(20, 40);
-ctx.arc(80, 40, 0, 0, 6, false);
-ctx.stroke();
-shouldBeBlackPixel(50, 40)
-
-// empty arc (swing == 0) + lineTo
-ctx.beginPath();
-ctx.arc(20, 50, 10, Math.PI/2, Math.PI/2, false);
-ctx.lineTo(80, 60);
-ctx.stroke();
-shouldBeBlackPixel(50, 60);
-
-// empty arc (radius == 0) + lineTo
-ctx.beginPath();
-ctx.arc(20, 80, 0, 0, 6, false);
-ctx.lineTo(80, 80);
-ctx.stroke();
-shouldBeBlackPixel(50, 80);
+test(function(t) {
+ var ctx = document.getElementById('canvas').getContext('2d');
+ ctx.lineWidth = 4;
+
+ // moveTo + empty arc (swing == 0)
+ ctx.beginPath();
+ ctx.moveTo(20, 20);
+ ctx.arc(80, 30, 10, -Math.PI/2, -Math.PI/2, true);
+ ctx.stroke();
+ shouldBeBlackPixel(ctx, 50, 20);
+
+ // moveTo + empty arc (radius == 0)
+ ctx.beginPath();
+ ctx.moveTo(20, 40);
+ ctx.arc(80, 40, 0, 0, 6, false);
+ ctx.stroke();
+ shouldBeBlackPixel(ctx, 50, 40)
+
+ // empty arc (swing == 0) + lineTo
+ ctx.beginPath();
+ ctx.arc(20, 50, 10, Math.PI/2, Math.PI/2, false);
+ ctx.lineTo(80, 60);
+ ctx.stroke();
+ shouldBeBlackPixel(ctx, 50, 60);
+
+ // empty arc (radius == 0) + lineTo
+ ctx.beginPath();
+ ctx.arc(20, 80, 0, 0, 6, false);
+ ctx.lineTo(80, 80);
+ ctx.stroke();
+ shouldBeBlackPixel(ctx, 50, 80);
+}, 'Series of tests to ensure zero-length arc extends current subpath (bug 55696)');
</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698