| 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" src="depth_stream_test_utilities.js"></script> |
| 4 <script type="text/javascript"> | 5 <script type="text/javascript"> |
| 5 $ = function(id) { | 6 $ = function(id) { |
| 6 return document.getElementById(id); | 7 return document.getElementById(id); |
| 7 }; | 8 }; |
| 8 | 9 |
| 9 setAllEventsOccuredHandler(function() { | 10 setAllEventsOccuredHandler(function() { |
| 10 reportTestSuccess(); | 11 reportTestSuccess(); |
| 11 }); | 12 }); |
| 12 | 13 |
| 13 function getSources() { | 14 function getSources() { |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // it directly. We do this so we catch crashes that occur in the | 337 // it directly. We do this so we catch crashes that occur in the |
| 337 // current execution context, but after reportTestSuccess is | 338 // current execution context, but after reportTestSuccess is |
| 338 // invoked. | 339 // invoked. |
| 339 setTimeout(function () { | 340 setTimeout(function () { |
| 340 window.parent.reportTestSuccess(); | 341 window.parent.reportTestSuccess(); |
| 341 }, 0); | 342 }, 0); |
| 342 }); | 343 }); |
| 343 } | 344 } |
| 344 } | 345 } |
| 345 | 346 |
| 347 // testVideoToImageBitmap is a layout test that we run here because |
| 348 // it requires --use-fake-device-for-media-capture. |
| 349 function getDepthStreamAndCallCreateImageBitmap() { |
| 350 console.log('Calling getDepthStreamAndCallCreateImageBitmap'); |
| 351 getFake16bitStream().then(function(stream) { |
| 352 detectVideoInLocalView1(stream, function() { |
| 353 testVideoToImageBitmap('local-view-1', function() { |
| 354 stream.getVideoTracks()[0].stop(); |
| 355 waitForVideoToStop('local-view-1'); |
| 356 }, failedCallback); |
| 357 }); |
| 358 }, |
| 359 failedCallback); |
| 360 } |
| 361 |
| 346 function failedCallback(error) { | 362 function failedCallback(error) { |
| 347 failTest('GetUserMedia call failed with error name ' + error.name); | 363 failTest('GetUserMedia call failed with error name ' + error.name); |
| 348 } | 364 } |
| 349 | 365 |
| 350 function attachMediaStream(stream, videoElement) { | 366 function attachMediaStream(stream, videoElement) { |
| 351 var localStreamUrl = URL.createObjectURL(stream); | 367 var localStreamUrl = URL.createObjectURL(stream); |
| 352 $(videoElement).src = localStreamUrl; | 368 $(videoElement).src = localStreamUrl; |
| 353 } | 369 } |
| 354 | 370 |
| 355 function detectVideoInLocalView1(stream, callback) { | 371 function detectVideoInLocalView1(stream, callback) { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 </tr> | 556 </tr> |
| 541 <tr> | 557 <tr> |
| 542 <td><video id="local-view-2" width="320" height="240" autoplay | 558 <td><video id="local-view-2" width="320" height="240" autoplay |
| 543 style="display:none"></video></td> | 559 style="display:none"></video></td> |
| 544 <td><canvas id="local-view-2-canvas" width="320" height="240" | 560 <td><canvas id="local-view-2-canvas" width="320" height="240" |
| 545 style="display:none"></canvas></td> | 561 style="display:none"></canvas></td> |
| 546 </tr> | 562 </tr> |
| 547 </table> | 563 </table> |
| 548 </body> | 564 </body> |
| 549 </html> | 565 </html> |
| OLD | NEW |