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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-empty-fill.html

Issue 2693193003: 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-stroke-empty-fill.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-empty-fill.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-empty-fill.html
index 439f85cc2abb8c7d9bbe47e4d38ee7cdbe3aa3b2..f572d14ed0ef0fa26d98bba77d2ed0761eaa1b10 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-empty-fill.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-empty-fill.html
@@ -1,9 +1,17 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script src="canvas-stroke-empty-fill.js"></script>
-</body>
-</html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+test(function(t) {
+ var ctx = document.createElement('canvas').getContext('2d');
+
+ ctx.fillStyle = 'rgba(0,0,0,0)';
+ ctx.strokeStyle = 'green';
+ ctx.lineWidth = 200;
+ ctx.moveTo(0,100);
+ ctx.lineTo(200,100);
+ ctx.stroke();
+ var imageData = ctx.getImageData(1, 0, 1, 1).data;
+ assert_array_equals(imageData.slice(0, 3), [0, 128, 0]);
+}, 'Verify correct behaviour for stroke() on an empty fillStyle() (alpha=0).');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698