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

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

Issue 2690183006: 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-stroke-zeroSizeGradient-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-stroke-zeroSizeGradient.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-zeroSizeGradient.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-zeroSizeGradient.html
index 1022fe1589f06be0ef9a880398824737d0693d51..3436cbc81fcc2e72fb3a1c3fbf299ac0e708160f 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-zeroSizeGradient.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-zeroSizeGradient.html
@@ -1,9 +1,21 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<body>
-<script src="script-tests/canvas-stroke-zeroSizeGradient.js"></script>
+<script>
+test(function(t) {
+ var ctx = document.createElement('canvas').getContext('2d');
+
+ ctx.fillStyle = '#0f0';
+ ctx.fillRect(0, 0, 1, 1);
+
+ var g = ctx.createLinearGradient(0, 0, 0, 0); // zero-length line (undefined direction);
+ g.addColorStop(0, '#f00');
+ g.addColorStop(1, '#f00');
+ ctx.strokeStyle = g;
+ ctx.rect(0, 0, 1 , 1);
+ ctx.stroke();
+
+ assert_array_equals(ctx.getImageData(0, 0, 1, 1).data.slice(0,3), [0, 255, 0]);
+}, "Series of tests to ensure that stroke() paints nothing on canvas when the strokeStyle is set to a zero-size gradient.");
+</script>
</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-stroke-zeroSizeGradient-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698