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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-shadow.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-shadow.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-shadow.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-shadow.html
index 4a2c17643abbacfec7d5e7fd04b955bbff64eb1c..fe72b80dc2a96e753ed5aa2697cb4952663f47f5 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-shadow.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-shadow.html
@@ -1,9 +1,32 @@
-<!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-shadow.js"></script>
+<script>
+var ctx = document.createElement('canvas').getContext('2d');
+
+function checkPixel(x, y, rgb) {
+ assert_array_equals(ctx.getImageData(x, y, 1, 1).data.slice(0,3), rgb);
+}
+
+test(function(t) {
+
+ ctx.fillStyle = "green";
+ ctx.fillRect(0, 0, 100, 100);
+ ctx.shadowColor = "green";
+ ctx.shadowOffsetX = 0;
+ ctx.shadowOffsetY = 0;
+ ctx.shadowBlur = 0;
+ checkPixel(1, 0, [0, 128, 0]);
+
+ ctx.clearRect(0, 0, 200, 50);
+ ctx.shadowColor = "green";
+ ctx.shadowOffsetX = 100;
+ ctx.shadowOffsetY = 0;
+ ctx.shadowBlur = 2;
+ ctx.fillStyle = "green";
+ ctx.fillRect(0, 0, 100, 50);
+ checkPixel(111, 10, [0, 128, 0]);
+
+}, "Some tests for Canvas shadows");
+</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698