OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> |
| 4 <script type="text/javascript" src="depth_stream_test_utilities.js"></script> |
| 5 <script type="text/javascript"> |
| 6 |
| 7 $ = function(id) { |
| 8 return document.getElementById(id); |
| 9 }; |
| 10 |
| 11 setAllEventsOccuredHandler(function() { |
| 12 reportTestSuccess(); |
| 13 }); |
| 14 |
| 15 // testVideoToImageBitmap is a layout test that we run here because |
| 16 // it requires --use-fake-device-for-media-capture. |
| 17 function getDepthStreamAndCallCreateImageBitmap() { |
| 18 console.log('Calling getDepthStreamAndCallCreateImageBitmap'); |
| 19 getFake16bitStream().then(function(stream) { |
| 20 detectVideoInLocalView1(stream, function() { |
| 21 testVideoToImageBitmap('local-view-1', function() { |
| 22 stream.getVideoTracks()[0].stop(); |
| 23 waitForVideoToStop('local-view-1'); |
| 24 }, failedCallback); |
| 25 }); |
| 26 }, |
| 27 failedCallback); |
| 28 } |
| 29 |
| 30 function failedCallback(error) { |
| 31 failTest('GetUserMedia call failed with error name ' + error.name); |
| 32 } |
| 33 |
| 34 function attachMediaStream(stream, videoElement) { |
| 35 var localStreamUrl = URL.createObjectURL(stream); |
| 36 $(videoElement).src = localStreamUrl; |
| 37 } |
| 38 |
| 39 function detectVideoInLocalView1(stream, callback) { |
| 40 attachMediaStream(stream, 'local-view-1'); |
| 41 detectVideoPlaying('local-view-1', callback); |
| 42 } |
| 43 </script> |
| 44 </head> |
| 45 <body> |
| 46 <table border="0"> |
| 47 <!-- Canvases are named after their corresponding video elements. --> |
| 48 <tr> |
| 49 <td><video id="local-view-1" width="96" height="96" autoplay |
| 50 style="display:none"></video></td> |
| 51 <td><canvas id="local-view-1-canvas" width="96" height="96" |
| 52 style="display:none"></canvas></td> |
| 53 </tr> |
| 54 </table> |
| 55 </body> |
| 56 </html> |
OLD | NEW |