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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/text-globalAlpha.html

Issue 2343793002: Convert fast/canvas Layouttests to testharness (Closed)
Patch Set: Convert fast/canvas Layouttests to testharness Created 4 years, 3 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/text-globalAlpha.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/text-globalAlpha.html b/third_party/WebKit/LayoutTests/fast/canvas/text-globalAlpha.html
index bdb6b31c2d1a62924b4f494875516179688fc9ac..0c56557affb2eadf258eeb5710a7ea06066496e2 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/text-globalAlpha.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/text-globalAlpha.html
@@ -1,9 +1,18 @@
<!DOCTYPE HTML>
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script src="script-tests/text-globalAlpha.js"></script>
-</body>
-</html>
+<title>Ensure that globalAlpha is applied correctly to text.</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<script>
+test(function() {
+ var canvas = document.createElement('canvas');
+ var ctx = canvas.getContext('2d');
+ ctx.fillStyle = "black";
+ ctx.globalAlpha = 0.5;
+ ctx.font = "50px Arial";
+ ctx.fillText("A",50,50);
+ var imageData = ctx.getImageData(63, 22, 1, 1).data;
+ var expectedValue = [127, 128];
+ assert_in_array(imageData[3], expectedValue);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698