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

Unified Diff: media/test/data/blackwhite.html

Issue 2345073002: Clean up the media color format content_browsertests (Closed)
Patch Set: Disable on chromos 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
« no previous file with comments | « content/test/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/test/data/blackwhite.html
diff --git a/media/test/data/blackwhite.html b/media/test/data/blackwhite.html
index 8230b6baf1e561c14997340ac5dcfee8934ffe1d..735e4adb4beabf8df0b014cd3f154d088bff34e0 100644
--- a/media/test/data/blackwhite.html
+++ b/media/test/data/blackwhite.html
@@ -117,8 +117,8 @@
var offscreen = document.createElement('canvas');
offscreen.width = videoElem.videoWidth;
offscreen.height = videoElem.videoHeight;
- offscreen.getContext('2d')
- .drawImage(videoElem, 0, 0, offscreen.width, offscreen.height);
+ offscreen.getContext('2d').drawImage(videoElem, 0, 0, offscreen.width,
+ offscreen.height);
videoData = getCanvasPixels(offscreen);
if (!videoData)
@@ -128,8 +128,10 @@
// expected value, |expected|, with up to |allowedError| difference.
function checkColor(imgData, x, y, stride, expected, allowedError) {
for (var i = 0; i < 3; ++i) {
- if (Math.abs(imgData[(x + y * stride) * 4 + i] - expected) >
- allowedError) {
+ var actual = imgData[(x + y * stride) * 4 + i];
+ if (Math.abs(actual - expected) > allowedError) {
+ log('Color didn\'t match at (' + x + ', ' + y + '). Expected: ' +
+ expected + ', actual: ' + actual);
return false;
}
}
« no previous file with comments | « content/test/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698