Chromium Code Reviews| Index: test/data/webrtc/getusermedia.js | 
| =================================================================== | 
| --- test/data/webrtc/getusermedia.js (revision 191906) | 
| +++ test/data/webrtc/getusermedia.js (working copy) | 
| @@ -39,8 +39,8 @@ | 
| * and optional constraints defined. The contents of this parameter depends | 
| * on the WebRTC version. This should be JavaScript code that we eval(). | 
| */ | 
| -function getUserMedia(constraints) { | 
| - if (!navigator.webkitGetUserMedia) { | 
| +function doGetUserMedia(constraints) { | 
| + if (!getUserMedia) { | 
| returnToTest('Browser does not support WebRTC.'); | 
| return; | 
| } | 
| @@ -50,18 +50,17 @@ | 
| } catch (exception) { | 
| throw failTest('Not valid JavaScript expression: ' + constraints); | 
| } | 
| - debug('Requesting getUserMedia: constraints: ' + constraints); | 
| - navigator.webkitGetUserMedia(evaluatedConstraints, | 
| - getUserMediaOkCallback_, | 
| - getUserMediaFailedCallback_); | 
| + debug('Requesting doGetUserMedia: constraints: ' + constraints); | 
| + getUserMedia(evaluatedConstraints, getUserMediaOkCallback_, | 
| + getUserMediaFailedCallback_); | 
| 
 
kjellander_chromium
2013/04/03 09:09:51
I'm sorry if I confused you a little in the previo
 
elham
2013/04/08 19:19:18
Done.
 
 | 
| returnToTest('ok-requested'); | 
| } | 
| /** | 
| - * Must be called after calling getUserMedia. Returns not-called-yet if we have | 
| - * not yet been called back by WebRTC. Otherwise it returns either ok-got-stream | 
| - * or failed-with-error-x (where x is the error code from the error callback) | 
| - * depending on which callback got called by WebRTC. | 
| + * Must be called after calling doGetUserMedia. Returns not-called-yet if we | 
| + * have not yet been called back by WebRTC. Otherwise it returns either | 
| + * ok-got-stream or failed-with-error-x (where x is the error code from the | 
| + * error callback) depending on which callback got called by WebRTC. | 
| */ | 
| function obtainGetUserMediaResult() { | 
| returnToTest(gRequestWebcamAndMicrophoneResult); | 
| @@ -131,8 +130,7 @@ | 
| function getUserMediaOkCallback_(stream) { | 
| gLocalStream = stream; | 
| var videoTag = $('local-view'); | 
| - videoTag.src = webkitURL.createObjectURL(stream); | 
| - | 
| + attachMediaStream(videoTag, stream); | 
| // Due to crbug.com/110938 the size is 0 when onloadedmetadata fires. | 
| // videoTag.onloadedmetadata = updateVideoTagSize_('local-view'); | 
| // Use setTimeout as a workaround for now. |