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

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

Issue 131613005: Fixed video muting test on Android, added logging. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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/data/media/webrtc_test_audio.js ('k') | 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 249a9708d1fe9855bc7d90bee2e831207033c634..3bd98a4cdb28c899878f331667bb1021e310ceac 100644
--- a/content/test/data/media/webrtc_test_utilities.js
+++ b/content/test/data/media/webrtc_test_utilities.js
@@ -37,11 +37,13 @@ function detectVideoStopped(videoElementName, callback) {
}
function detectVideo(videoElementName, predicate, callback) {
+ console.log('Looking at video in element ' + videoElementName);
+
var width = VIDEO_TAG_WIDTH;
var height = VIDEO_TAG_HEIGHT;
var videoElement = $(videoElementName);
var canvas = $(videoElementName + '-canvas');
- var old_pixels = [];
+ var oldPixels = [];
var waitVideo = setInterval(function() {
var context = canvas.getContext('2d');
context.drawImage(videoElement, 0, 0, width, height);
@@ -49,12 +51,13 @@ function detectVideo(videoElementName, predicate, callback) {
// Check that there is an old and a new picture with the same size to
// compare and use the function |predicate| to detect the video state in
// that case.
- if (old_pixels.length == pixels.length &&
- predicate(pixels, old_pixels)) {
+ if (oldPixels.length == pixels.length &&
+ predicate(pixels, oldPixels)) {
+ console.log('Done looking at video in element ' + videoElementName);
clearInterval(waitVideo);
callback();
}
- old_pixels = pixels;
+ oldPixels = pixels;
}, 200);
}
@@ -92,9 +95,9 @@ function eventOccured() {
// This very basic video verification algorithm will be satisfied if any
// pixels are changed.
-function isVideoPlaying(pixels, previous_pixels) {
+function isVideoPlaying(pixels, previousPixels) {
for (var i = 0; i < pixels.length; i++) {
- if (pixels[i] != previous_pixels[i]) {
+ if (pixels[i] != previousPixels[i]) {
return true;
}
}
« no previous file with comments | « content/test/data/media/webrtc_test_audio.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698