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

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

Issue 2343793002: Convert fast/canvas Layouttests to testharness (Closed)
Patch Set: Removing the non js-test and adding new synchronous test 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..58fa145370a369c51226794eb7d8f996d5db04b8 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/text-globalAlpha.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/text-globalAlpha.html
@@ -1,9 +1,19 @@
<!DOCTYPE HTML>
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script src="script-tests/text-globalAlpha.js"></script>
Srirama 2016/09/16 06:58:43 I think it is not used anywhere else, so you can r
Abhishek Kanike 2016/09/16 08:53:41 Done.
-</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);
Srirama 2016/09/16 06:58:43 combine these two stmts. var imageData = ctx.getIm
Abhishek Kanike 2016/09/16 08:53:41 Done.
+ var imgdata = imageData.data;
+ var expectedValue = [127, 128];
+ assert_in_array(imgdata[3], expectedValue);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698