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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-helpers.js

Issue 2673883002: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-gradient-over-pattern-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-helpers.js
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-helpers.js b/third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-helpers.js
index ff34874b1d39ec80384ce9bd15b9048772431a4c..af2885c0eabb3e45db0367402371b1b9bc5ef8f3 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-helpers.js
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-helpers.js
@@ -300,3 +300,12 @@ function nonSeparateBlendColors(backdrop, source, blendModeIndex) {
expectedColor[i] = source[3] * (1 - backdrop[3]) * source[i] + source[3] * backdrop[3] * expectedColor[i] + (1 - source[3]) * backdrop[3] * backdrop[i];
return [Math.round(255 * expectedColor[0]), Math.round(255 * expectedColor[1]), Math.round(255 * expectedColor[2]), 255];
}
+
+function checkBlendModeResult(i, context, sigma) {
+ var actualColor = context.getImageData(0, 0, 1, 1).data;
+ var expectedColor = blendColors([129 / 255, 1, 129 / 255, 1], [1, 129 / 255, 129 / 255, 1], i);
+ assert_approx_equals(actualColor[0], expectedColor[0], sigma);
+ assert_approx_equals(actualColor[1], expectedColor[1], sigma);
+ assert_approx_equals(actualColor[2], expectedColor[2], sigma);
+ assert_approx_equals(actualColor[3], expectedColor[3], sigma);
+}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/canvas-blending-gradient-over-pattern-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698