diff options
author | phoglund@chromium.org <phoglund@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-09 15:19:45 +0000 |
---|---|---|
committer | phoglund@chromium.org <phoglund@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-09 15:19:45 +0000 |
commit | 7bbc7e632ea091b0ce811d7d778b43b0f14ba7c1 (patch) | |
tree | 3141c400755e8109069738a9c9030049b3a0a885 /content/test | |
parent | d0d08e95ffa4b1c9d9811ad097bcaa968f65fb90 (diff) | |
download | chromium_src-7bbc7e632ea091b0ce811d7d778b43b0f14ba7c1.zip chromium_src-7bbc7e632ea091b0ce811d7d778b43b0f14ba7c1.tar.gz chromium_src-7bbc7e632ea091b0ce811d7d778b43b0f14ba7c1.tar.bz2 |
Fixed video muting test on Android, added logging.
The video muting test didn't force iSAC correctly. Also added some
lightweight log statements to make it easier to see how far we get when
the test fails.
BUG=332765
TBR=wjia@chromium.org
Review URL: https://codereview.chromium.org/131613005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243904 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test')
-rw-r--r-- | content/test/data/media/peerconnection-call.html | 4 | ||||
-rw-r--r-- | content/test/data/media/webrtc_test_audio.js | 6 | ||||
-rw-r--r-- | content/test/data/media/webrtc_test_utilities.js | 15 |
3 files changed, 17 insertions, 8 deletions
diff --git a/content/test/data/media/peerconnection-call.html b/content/test/data/media/peerconnection-call.html index 0cfe6e97..034dc4b 100644 --- a/content/test/data/media/peerconnection-call.html +++ b/content/test/data/media/peerconnection-call.html @@ -627,6 +627,7 @@ } function negotiateBetween(caller, callee) { + console.log("Negotiating call..."); // Not stable = negotiation is ongoing. The behavior of re-negotiating while // a negotiation is ongoing is more or less undefined, so avoid this. if (caller.signalingState != 'stable') @@ -649,6 +650,7 @@ } function receiveOffer(offerSdp, caller, callee) { + console.log("Receiving offer..."); offerSdp = transformRemoteSdp(offerSdp); var parsedOffer = new RTCSessionDescription({ type: 'offer', @@ -714,6 +716,7 @@ } function receiveAnswer(answerSdp, caller) { + console.log("Receiving answer..."); answerSdp = transformRemoteSdp(answerSdp); var parsedAnswer = new RTCSessionDescription({ type: 'answer', sdp: answerSdp }); @@ -740,6 +743,7 @@ } function onRemoteStream(e, target) { + console.log("Receiving remote stream..."); if (gTestWithoutMsid && e.stream.id != "default") { document.title = 'a default remote stream was expected but instead ' + e.stream.id + ' was received.'; diff --git a/content/test/data/media/webrtc_test_audio.js b/content/test/data/media/webrtc_test_audio.js index c9910be..68312ed 100644 --- a/content/test/data/media/webrtc_test_audio.js +++ b/content/test/data/media/webrtc_test_audio.js @@ -8,11 +8,13 @@ // calls back |callback| with an array with numbers in the [0, 32768] range. function gatherAudioLevelSamples(peerConnection, numSamples, frequency, callback) { + console.log('Gathering ' + numSamples + ' audio samples...'); var audioLevelSamples = [] var gatherSamples = setInterval(function() { peerConnection.getStats(function(response) { audioLevelSamples.push(getAudioLevelFromStats_(response)); if (audioLevelSamples.length == numSamples) { + console.log('Gathered all samples.'); clearInterval(gatherSamples); callback(audioLevelSamples); } @@ -42,7 +44,7 @@ function verifyAudioIsPlaying(samples) { 'to be 4000 < avg < 8000.' if (largest < 25000) throw 'Too low max audio level: got ' + largest + ', expected > 30000.'; -}; +} // If silent (like when muted), we should get very near zero audio level. function verifyIsSilent(samples) { @@ -71,4 +73,4 @@ function getAudioLevelFromStats_(response) { expectEquals(1, audioOutputLevels.length); return audioOutputLevels[0]; -}
\ No newline at end of file +} diff --git a/content/test/data/media/webrtc_test_utilities.js b/content/test/data/media/webrtc_test_utilities.js index 249a970..3bd98a4 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; } } |