OLD | NEW |
---|---|
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> | 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> |
4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
5 $ = function(id) { | 5 $ = function(id) { |
6 return document.getElementById(id); | 6 return document.getElementById(id); |
7 }; | 7 }; |
8 | 8 |
9 var gLocalStream = null; | 9 var gLocalStream = null; |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... | |
23 // Creates a MediaStream and renders it locally. When the video is detected to | 23 // Creates a MediaStream and renders it locally. When the video is detected to |
24 // be rolling, the title is changed and the stream should be stopped. | 24 // be rolling, the title is changed and the stream should be stopped. |
25 function getUserMediaAndStop(constraints) { | 25 function getUserMediaAndStop(constraints) { |
26 console.log('Calling getUserMediaAndStop.'); | 26 console.log('Calling getUserMediaAndStop.'); |
27 navigator.webkitGetUserMedia( | 27 navigator.webkitGetUserMedia( |
28 constraints, | 28 constraints, |
29 function(stream) { displayAndDetectVideo(stream, stopVideoTrack); }, | 29 function(stream) { displayAndDetectVideo(stream, stopVideoTrack); }, |
30 failedCallback); | 30 failedCallback); |
31 } | 31 } |
32 | 32 |
33 // Requests getusermedia and expects it to fail. | 33 // Requests getusermedia and expects it to fail. |
phoglund_chromium
2014/03/14 15:26:10
Nit: comment that it returns the error name.
| |
34 function getUserMediaAndExpectFailure(constraints) { | 34 function getUserMediaAndExpectFailure(constraints) { |
35 console.log('Calling getUserMediaAndExpectFailure.'); | 35 console.log('Calling getUserMediaAndExpectFailure.'); |
36 navigator.webkitGetUserMedia( | 36 navigator.webkitGetUserMedia( |
37 constraints, | 37 constraints, |
38 function(stream) { failTest('Unexpectedly succeeded getUserMedia.'); }, | 38 function(stream) { failTest('Unexpectedly succeeded getUserMedia.'); }, |
39 function(error) { reportTestSuccess(); }); | 39 function(error) { sendValueToTest(error.name); }); |
40 } | 40 } |
41 | 41 |
42 // Creates a MediaStream and renders it locally. When the video is detected to | 42 // Creates a MediaStream and renders it locally. When the video is detected to |
43 // be rolling we return ok-stream-running through the automation controller. | 43 // be rolling we return ok-stream-running through the automation controller. |
44 function getUserMediaAndGetStreamUp(constraints, waitTimeInSeconds) { | 44 function getUserMediaAndGetStreamUp(constraints, waitTimeInSeconds) { |
45 console.log('Calling getUserMediaAndGetStreamUp.'); | 45 console.log('Calling getUserMediaAndGetStreamUp.'); |
46 navigator.webkitGetUserMedia( | 46 navigator.webkitGetUserMedia( |
47 constraints, | 47 constraints, |
48 function(stream) { | 48 function(stream) { |
49 displayAndDetectVideo( | 49 displayAndDetectVideo( |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 <tr> | 267 <tr> |
268 <td><video width="320" height="240" id="local-view-2" | 268 <td><video width="320" height="240" id="local-view-2" |
269 autoplay="autoplay"></video></td> | 269 autoplay="autoplay"></video></td> |
270 <!-- Canvases are named after their corresponding video elements. --> | 270 <!-- Canvases are named after their corresponding video elements. --> |
271 <td><canvas width="320" height="240" id="local-view-2-canvas" | 271 <td><canvas width="320" height="240" id="local-view-2-canvas" |
272 style="display:none"></canvas></td> | 272 style="display:none"></canvas></td> |
273 </tr> | 273 </tr> |
274 </table> | 274 </table> |
275 </body> | 275 </body> |
276 </html> | 276 </html> |
OLD | NEW |