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="webrtc_test_audio.js"></script> | 4 <script type="text/javascript" src="webrtc_test_audio.js"></script> |
5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
6 $ = function(id) { | 6 $ = function(id) { |
7 return document.getElementById(id); | 7 return document.getElementById(id); |
8 }; | 8 }; |
9 | 9 |
10 var gFirstConnection = null; | 10 var gFirstConnection = null; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Test that we can setup call with an audio and video track. | 57 // Test that we can setup call with an audio and video track. |
58 function call(constraints) { | 58 function call(constraints) { |
59 createConnections(null); | 59 createConnections(null); |
60 navigator.webkitGetUserMedia(constraints, | 60 navigator.webkitGetUserMedia(constraints, |
61 addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); | 61 addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); |
62 waitForVideo('remote-view-1'); | 62 waitForVideo('remote-view-1'); |
63 waitForVideo('remote-view-2'); | 63 waitForVideo('remote-view-2'); |
64 } | 64 } |
65 | 65 |
| 66 // Test that we can setup call with an audio and video track and check that |
| 67 // the video resolution is as expected. |
| 68 function callAndExpectResolution(constraints, |
| 69 expected_width, |
| 70 expected_height) { |
| 71 createConnections(null); |
| 72 navigator.webkitGetUserMedia(constraints, |
| 73 addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); |
| 74 waitForVideoWithResolution('remote-view-1', |
| 75 expected_width, |
| 76 expected_height); |
| 77 waitForVideoWithResolution('remote-view-2', |
| 78 expected_width, |
| 79 expected_height); |
| 80 } |
| 81 |
| 82 |
66 // First calls without streams on any connections, and then adds a stream | 83 // First calls without streams on any connections, and then adds a stream |
67 // to peer connection 1 which gets sent to peer connection 2. We must wait | 84 // to peer connection 1 which gets sent to peer connection 2. We must wait |
68 // for the first negotiation to complete before starting the second one, which | 85 // for the first negotiation to complete before starting the second one, which |
69 // is why we wait until the connection is stable before re-negotiating. | 86 // is why we wait until the connection is stable before re-negotiating. |
70 function callEmptyThenAddOneStreamAndRenegotiate(constraints) { | 87 function callEmptyThenAddOneStreamAndRenegotiate(constraints) { |
71 createConnections(null); | 88 createConnections(null); |
72 negotiate(); | 89 negotiate(); |
73 waitForConnectionToStabilize(gFirstConnection, function() { | 90 waitForConnectionToStabilize(gFirstConnection, function() { |
74 navigator.webkitGetUserMedia(constraints, | 91 navigator.webkitGetUserMedia(constraints, |
75 addStreamToTheFirstConnectionAndNegotiate, printGetUserMediaError); | 92 addStreamToTheFirstConnectionAndNegotiate, printGetUserMediaError); |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 <td><canvas width="320" height="240" id="remote-view-2-canvas" | 857 <td><canvas width="320" height="240" id="remote-view-2-canvas" |
841 style="display:none"></canvas></td> | 858 style="display:none"></canvas></td> |
842 <td><canvas width="320" height="240" id="remote-view-3-canvas" | 859 <td><canvas width="320" height="240" id="remote-view-3-canvas" |
843 style="display:none"></canvas></td> | 860 style="display:none"></canvas></td> |
844 <td><canvas width="320" height="240" id="remote-view-4-canvas" | 861 <td><canvas width="320" height="240" id="remote-view-4-canvas" |
845 style="display:none"></canvas></td> | 862 style="display:none"></canvas></td> |
846 </tr> | 863 </tr> |
847 </table> | 864 </table> |
848 </body> | 865 </body> |
849 </html> | 866 </html> |
OLD | NEW |