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

Unified Diff: content/test/data/media/webrtc_test_utilities.js

Issue 601083002: Allow WebRTC tests that watch for black frames to be off by one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/media/webrtc_test_utilities.js
diff --git a/content/test/data/media/webrtc_test_utilities.js b/content/test/data/media/webrtc_test_utilities.js
index 6e9cde639dcdf5299182c84cb4a785eca4391d13..02aac59b325d27b8711e000f03a5027db4f52243 100644
--- a/content/test/data/media/webrtc_test_utilities.js
+++ b/content/test/data/media/webrtc_test_utilities.js
@@ -187,7 +187,9 @@ function isVideoPlaying(pixels, previousPixels) {
function isVideoBlack(pixels) {
for (var i = 0; i < pixels.length; i++) {
// |pixels| is in RGBA. Ignore the alpha channel.
- if (pixels[i] != 0 && (i + 1) % 4 != 0) {
+ // We allow it to be off by 1, to account for rounding errors in YUV
+ // conversion.
+ if (pixels[i] != 0 && pixels[i] != 1 && (i + 1) % 4 != 0) {
return false;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698