Chromium Code Reviews| 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 setAllEventsOccuredHandler(function() { | 9 setAllEventsOccuredHandler(function() { |
| 10 reportTestSuccess(); | 10 reportTestSuccess(); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 return; | 549 return; |
| 550 } | 550 } |
| 551 } | 551 } |
| 552 | 552 |
| 553 clearInterval(detectorInterval); | 553 clearInterval(detectorInterval); |
| 554 var result = "w=" + width + ":h=" + height; | 554 var result = "w=" + width + ":h=" + height; |
| 555 callback(result); | 555 callback(result); |
| 556 } | 556 } |
| 557 var detectorInterval = setInterval(detectorFunction, 50); | 557 var detectorInterval = setInterval(detectorFunction, 50); |
| 558 } | 558 } |
| 559 | |
| 560 function srcObjectAddVideoTrack() { | |
| 561 var video = document.createElement('video'); | |
| 562 video.autoplay = true; | |
| 563 assertEquals(video.srcObject, null); | |
| 564 var full_stream; | |
| 565 navigator.mediaDevices.getUserMedia({audio: true, video: true}) | |
| 566 .then(stream => { | |
| 567 video.onplaying = function() { | |
| 568 video.onplaying = null; | |
| 569 video.onloadstart = function() { | |
| 570 failTest("loadstart should not be called"); | |
| 571 } | |
| 572 | |
| 573 video.onresize = function() { | |
| 574 assertNotEquals(video.srcObject, null); | |
| 575 assertTrue(video.videoHeight > 0); | |
| 576 assertTrue(video.videoWidth > 0); | |
| 577 reportTestSuccess(); | |
| 578 } | |
| 579 | |
| 580 assertNotEquals(video.srcObject, null); | |
| 581 assertEquals(video.videoWidth, 0); | |
| 582 assertEquals(video.videoHeight, 0); | |
| 583 video.srcObject.addTrack(full_stream.getVideoTracks()[0]); | |
| 584 } | |
| 585 full_stream = stream; | |
| 586 video.srcObject = new MediaStream(stream.getAudioTracks()); | |
| 587 }) | |
| 588 .catch(e => { | |
| 589 failTest("Unexpected error: " + e) | |
| 590 }); | |
| 591 } | |
| 592 | |
| 593 function srcObjectRemoveVideoTrack() { | |
| 594 var video = document.createElement('video'); | |
| 595 video.autoplay = true; | |
| 596 assertEquals(video.srcObject, null); | |
| 597 var original_stream; | |
| 598 navigator.mediaDevices.getUserMedia({audio: true, video: true}) | |
| 599 .then(stream => { | |
| 600 video.onplaying = function() { | |
| 601 video.onplaying = null; | |
| 602 video.onloadstart = function() { | |
| 603 failTest("loadstart should not be called"); | |
| 604 } | |
| 605 | |
| 606 video.onresize = function() { | |
| 607 assertNotEquals(video.srcObject, null); | |
| 608 assertEquals(0, video.videoHeight); | |
| 609 assertEquals(0, video.videoWidth); | |
| 610 reportTestSuccess(); | |
| 611 } | |
| 612 | |
| 613 assertNotEquals(video.srcObject, null); | |
| 614 assertTrue(video.videoWidth > 0); | |
| 615 assertTrue(video.videoHeight > 0); | |
| 616 original_stream.removeTrack(original_stream.getVideoTracks()[0]); | |
| 617 } | |
| 618 original_stream = stream; | |
|
foolip
2017/07/05 08:49:44
original_stream===stream at every point in time af
Guido Urdaneta
2017/07/05 13:05:02
Done. Also for |full_stream| in the other test.
| |
| 619 video.srcObject = stream; | |
| 620 }) | |
| 621 .catch(e => { | |
| 622 failTest("Unexpected error: " + e) | |
| 623 }); | |
| 624 } | |
| 559 </script> | 625 </script> |
| 560 </head> | 626 </head> |
| 561 <body> | 627 <body> |
| 562 <table border="0"> | 628 <table border="0"> |
| 563 <!-- Canvases are named after their corresponding video elements. --> | 629 <!-- Canvases are named after their corresponding video elements. --> |
| 564 <tr> | 630 <tr> |
| 565 <td><video id="local-view-1" width="320" height="240" autoplay | 631 <td><video id="local-view-1" width="320" height="240" autoplay |
| 566 style="display:none"></video></td> | 632 style="display:none"></video></td> |
| 567 <td><canvas id="local-view-1-canvas" width="320" height="240" | 633 <td><canvas id="local-view-1-canvas" width="320" height="240" |
| 568 style="display:none"></canvas></td> | 634 style="display:none"></canvas></td> |
| 569 </tr> | 635 </tr> |
| 570 <tr> | 636 <tr> |
| 571 <td><video id="local-view-2" width="320" height="240" autoplay | 637 <td><video id="local-view-2" width="320" height="240" autoplay |
| 572 style="display:none"></video></td> | 638 style="display:none"></video></td> |
| 573 <td><canvas id="local-view-2-canvas" width="320" height="240" | 639 <td><canvas id="local-view-2-canvas" width="320" height="240" |
| 574 style="display:none"></canvas></td> | 640 style="display:none"></canvas></td> |
| 575 </tr> | 641 </tr> |
| 576 </table> | 642 </table> |
| 577 </body> | 643 </body> |
| 578 </html> | 644 </html> |
| OLD | NEW |