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

Side by Side Diff: content/test/data/media/webrtc_test_audio.js

Issue 190563002: Refactored how WebRTC content browser tests talk to their javascript. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed AEC dump tests on Andri Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Audio test utilities. 5 // Audio test utilities.
6 6
7 // Gathers |numSamples| samples at |frequency| number of times per second and 7 // Gathers |numSamples| samples at |frequency| number of times per second and
8 // calls back |callback| with an array with numbers in the [0, 32768] range. 8 // calls back |callback| with an array with numbers in the [0, 32768] range.
9 function gatherAudioLevelSamples(peerConnection, numSamples, frequency, 9 function gatherAudioLevelSamples(peerConnection, numSamples, frequency,
10 callback) { 10 callback) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 function getAudioLevelFromStats_(response) { 63 function getAudioLevelFromStats_(response) {
64 var reports = response.result(); 64 var reports = response.result();
65 var audioOutputLevels = []; 65 var audioOutputLevels = [];
66 for (var i = 0; i < reports.length; ++i) { 66 for (var i = 0; i < reports.length; ++i) {
67 var report = reports[i]; 67 var report = reports[i];
68 if (report.names().indexOf('audioOutputLevel') != -1) { 68 if (report.names().indexOf('audioOutputLevel') != -1) {
69 audioOutputLevels.push(report.stat('audioOutputLevel')); 69 audioOutputLevels.push(report.stat('audioOutputLevel'));
70 } 70 }
71 } 71 }
72 // Should only be one audio level reported, otherwise we get confused. 72 // Should only be one audio level reported, otherwise we get confused.
73 expectEquals(1, audioOutputLevels.length); 73 assertEquals(1, audioOutputLevels.length);
74 74
75 return audioOutputLevels[0]; 75 return audioOutputLevels[0];
76 } 76 }
OLDNEW
« no previous file with comments | « content/test/data/media/peerconnection-call.html ('k') | content/test/data/media/webrtc_test_utilities.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698