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

Unified Diff: chrome/test/data/webrtc/getusermedia.js

Issue 271653002: Rewrote WebRTC browser tests to not use peerconnection_server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit fixes Created 6 years, 7 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 | « chrome/browser/media/webrtc_browsertest_common.cc ('k') | chrome/test/data/webrtc/jsep01_call.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/getusermedia.js
diff --git a/chrome/test/data/webrtc/getusermedia.js b/chrome/test/data/webrtc/getusermedia.js
index 49be28aebce5669aec05554ac39cc5738e311d3c..bb66b59bac2f50a264fc34a08190ced5a4db19a8 100644
--- a/chrome/test/data/webrtc/getusermedia.js
+++ b/chrome/test/data/webrtc/getusermedia.js
@@ -121,22 +121,6 @@ function addLocalStreamToPeerConnection(peerConnection) {
}
/**
- * Removes the local stream from the peer connection.
- * @param {rtcpeerconnection} peerConnection
- */
-function removeLocalStreamFromPeerConnection(peerConnection) {
- if (gLocalStream == null)
- throw failTest('Tried to remove local stream from peer connection, ' +
- 'but there is no stream yet.');
- try {
- peerConnection.removeStream(gLocalStream);
- } catch (exception) {
- throw failTest('Could not remove stream: ' + exception);
- }
- debug('Removed local stream.');
-}
-
-/**
* @return {string} Returns the current local stream - |gLocalStream|.
*/
function getLocalStream() {
@@ -179,92 +163,6 @@ function getUserMediaOkCallback_(stream) {
}
/**
- * Enumerates the audio and video devices available in Chrome and adds the
- * devices to the HTML elements with Id 'audiosrc' and 'videosrc'.
- * Checks if device enumeration is supported and if the 'audiosrc' + 'videosrc'
- * elements exists, if not a debug printout will be displayed.
- * If the device label is empty, audio/video + sequence number will be used to
- * populate the name. Also makes sure the children has been loaded in order
- * to update the constraints.
- */
-function getDevices() {
- if ($('audiosrc') && $('videosrc') && $('get-devices')) {
- var audio_select = $('audiosrc');
- var video_select = $('videosrc');
- var get_devices = $('get-devices');
- audio_select.innerHTML = '';
- video_select.innerHTML = '';
- try {
- eval(MediaStreamTrack.getSources(function() {}));
- } catch (exception) {
- audio_select.disabled = true;
- video_select.disabled = true;
- get_devices.disabled = true;
- updateGetUserMediaConstraints();
- debug('Device enumeration not supported. ' + exception);
- return;
- }
- MediaStreamTrack.getSources(function(devices) {
- for (var i = 0; i < devices.length; i++) {
- var option = document.createElement('option');
- option.value = devices[i].id;
- option.text = devices[i].label;
- if (devices[i].kind == 'audio') {
- if (option.text == '') {
- option.text = devices[i].id;
- }
- audio_select.appendChild(option);
- }
- else if (devices[i].kind == 'video') {
- if (option.text == '') {
- option.text = devices[i].id;
- }
- video_select.appendChild(option);
- }
- else {
- debug('Device type ' + devices[i].kind + ' not recognized, cannot ' +
- 'enumerate device. Currently only device types \'audio\' and ' +
- '\'video\' are supported');
- updateGetUserMediaConstraints();
- return;
- }
- }
- });
- checkIfDeviceDropdownsArePopulated();
- }
- else {
- debug('Device DOM elements cannot be found, cannot display devices');
- updateGetUserMediaConstraints();
- }
-}
-
-/**
- * This provides the selected source id from the objects in the parameters
- * provided to this function. If the audio_select or video_select objects does
- * not have any HTMLOptions children it will return null in the source object.
- * @param {object} audio_select HTML drop down element with audio devices added
- * as HTMLOptionsCollection children.
- * @param {object} video_select HTML drop down element with audio devices added
- * as HTMLPptionsCollection children.
- * @return {object} audio_id video_id Containing audio and video source ID from
- * the selected devices in the drop down menus provided as parameters to
- * this function.
- */
-function getSourcesFromField(audio_select, video_select) {
- var source = {
- audio_id: null,
- video_id: null
- };
- if (audio_select.options.length > 0) {
- source.audio_id = audio_select.options[audio_select.selectedIndex].value;
- }
- if (video_select.options.length > 0) {
- source.video_id = video_select.options[video_select.selectedIndex].value;
- }
- return source;
-}
-
-/**
* @private
* @param {NavigatorUserMediaError} error Error containing details.
*/
« no previous file with comments | « chrome/browser/media/webrtc_browsertest_common.cc ('k') | chrome/test/data/webrtc/jsep01_call.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698