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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-path-constructors.html

Issue 2694703004: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: 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-path-constructors.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-constructors.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-constructors.html
index d70f6b88b7f57199f017dfd33649b74ce1f67136..d6eae78431a5db5eaaf61b2434d605043d6dc091 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-constructors.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-constructors.html
@@ -1,9 +1,30 @@
-<!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-path-constructors.js"></script>
+<script>
+test(function(t) {
+ var ctx = document.createElement('canvas').getContext('2d');
+
+ ctx.beginPath();
+ var p1 = new Path2D();
+ p1.rect(0,0,100,100);
+ ctx.fillStyle = 'yellow';
+ ctx.fill(p1);
+ assert_array_equals(ctx.getImageData(1, 0, 1, 1).data, [255, 255, 0, 255]);
+
+ ctx.beginPath();
+ var p2 = new Path2D("M100,0L200,0L200,100L100,100z");
+ ctx.fillStyle = 'blue';
+ ctx.fill(p2);
+ assert_array_equals(ctx.getImageData(101, 0, 1, 1).data, [0, 0, 255, 255]);
+
+ ctx.beginPath();
+ var p3 = new Path2D(p1);
+ ctx.translate(200,0);
+ ctx.fillStyle = 'green';
+ ctx.fill(p3);
+ ctx.translate(-200,0);
+ assert_array_equals(ctx.getImageData(201, 0, 1, 1).data, [0, 128, 0, 255]);
+}, "Test different constructors of Path.");
+</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698