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

Side by Side Diff: chrome/test/data/webrtc/getusermedia.js

Issue 10957035: Adapted tests to API change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed video quality test, which will be coming up soon. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/webrtc/jsep01_call.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /** 7 /**
8 * See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more 8 * See http://dev.w3.org/2011/webrtc/editor/getusermedia.html for more
9 * information on getUserMedia. 9 * information on getUserMedia.
10 */ 10 */
(...skipping 27 matching lines...) Expand all
38 * @param requestVideo, requestAudio: whether to request video/audio. 38 * @param requestVideo, requestAudio: whether to request video/audio.
39 * @param mediaHints The media hints to use when we add streams to a peer 39 * @param mediaHints The media hints to use when we add streams to a peer
40 * connection later. The contents of this parameter depends on the WebRTC 40 * connection later. The contents of this parameter depends on the WebRTC
41 * version. This should be javascript code that we eval(). 41 * version. This should be javascript code that we eval().
42 */ 42 */
43 function getUserMedia(requestVideo, requestAudio, mediaHints) { 43 function getUserMedia(requestVideo, requestAudio, mediaHints) {
44 if (!navigator.webkitGetUserMedia) { 44 if (!navigator.webkitGetUserMedia) {
45 returnToTest('Browser does not support WebRTC.'); 45 returnToTest('Browser does not support WebRTC.');
46 return; 46 return;
47 } 47 }
48 eval('gMediaHints = ' + mediaHints); 48 try {
49 eval('gMediaHints = ' + mediaHints);
50 } catch (exception) {
51 failTest('Not valid javascript expression: ' + mediaHints);
52 }
49 53
50 debug('Requesting: video ' + requestVideo + ', audio ' + requestAudio); 54 debug('Requesting: video ' + requestVideo + ', audio ' + requestAudio);
51 navigator.webkitGetUserMedia({video: requestVideo, audio: requestAudio}, 55 navigator.webkitGetUserMedia({video: requestVideo, audio: requestAudio},
52 getUserMediaOkCallback_, 56 getUserMediaOkCallback_,
53 getUserMediaFailedCallback_); 57 getUserMediaFailedCallback_);
54 returnToTest('ok-requested'); 58 returnToTest('ok-requested');
55 } 59 }
56 60
57 /** 61 /**
58 * Must be called after calling getUserMedia. Returns not-called-yet if we have 62 * Must be called after calling getUserMedia. Returns not-called-yet if we have
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 var streamUrl = webkitURL.createObjectURL(stream); 129 var streamUrl = webkitURL.createObjectURL(stream);
126 document.getElementById('local-view').src = streamUrl; 130 document.getElementById('local-view').src = streamUrl;
127 131
128 gRequestWebcamAndMicrophoneResult = 'ok-got-stream'; 132 gRequestWebcamAndMicrophoneResult = 'ok-got-stream';
129 } 133 }
130 134
131 /** @private */ 135 /** @private */
132 function getUserMediaFailedCallback_(error) { 136 function getUserMediaFailedCallback_(error) {
133 gRequestWebcamAndMicrophoneResult = 'failed-with-error-' + error.code; 137 gRequestWebcamAndMicrophoneResult = 'failed-with-error-' + error.code;
134 } 138 }
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/webrtc/jsep01_call.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698