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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-transparency-and-composite.html

Issue 2693043012: 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-transparency-and-composite.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-transparency-and-composite.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-transparency-and-composite.html
index 79532b4a50080fd28fb4b10a7d5e492732f2f2e1..f711783736577410974b7c98af9c7db39da37ff4 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-transparency-and-composite.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-transparency-and-composite.html
@@ -1,9 +1,24 @@
-<!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-transparency-and-composite.js"></script>
+
+<script>
+test(function(t) {
+
+ var ctx = document.createElement('canvas').getContext('2d');
+ ctx.globalCompositeOperation = "source-over";
+ ctx.fillStyle = 'rgba(0, 0, 0, 0)';
+ ctx.fillRect(0, 0, 100, 100);
+
+ ctx.save();
+ ctx.translate(0, 100);
+ ctx.scale(1, -1);
+ ctx.fillStyle = 'green';
+ ctx.fillRect(0, 0, 100, 100);
+ ctx.restore();
+
+ assert_array_equals(ctx.getImageData(2, 1, 1, 1).data.slice(0, 3), [0, 128, 0]);
+
+}, "Series of tests to ensure correct behaviour of composite on a fully transparent color.");
+</script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698