OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script type="text/javascript"> | 3 <script type="text/javascript"> |
4 $ = function(id) { | 4 $ = function(id) { |
5 return document.getElementById(id); | 5 return document.getElementById(id); |
6 }; | 6 }; |
7 | 7 |
8 var gFirstConnection = null; | 8 var gFirstConnection = null; |
9 var gSecondConnection = null; | 9 var gSecondConnection = null; |
10 var gTestWithoutMsidAndBundle = false; | 10 var gTestWithoutMsidAndBundle = false; |
11 | 11 |
12 // Number of test events to occur before the test pass. When the test pass, | 12 // Number of test events to occur before the test pass. When the test pass, |
13 // the document title change to OK. | 13 // the document title change to OK. |
14 var gNumberOfExpectedEvents = 0; | 14 var gNumberOfExpectedEvents = 0; |
15 | 15 |
16 // Number of events that currently have occured. | 16 // Number of events that currently have occured. |
17 var gNumberOfEvents = 0; | 17 var gNumberOfEvents = 0; |
18 | 18 |
19 // Test that we can setup call with an audio and video track. | 19 // Test that we can setup call with an audio and video track. |
20 function call(constraints) { | 20 function call(constraints) { |
21 createConnections(null); | 21 createConnections(null); |
22 navigator.webkitGetUserMedia(constraints, okCallback, failedCallback); | 22 navigator.webkitGetUserMedia(constraints, okCallback, failedCallback); |
23 waitForVideo($('remote-view'), 320, 240); | 23 waitForVideo($('remote-view'), 320, 240); |
24 } | 24 } |
25 | 25 |
26 // Test that we can setup call with an audio and video track and | 26 // Test that we can setup call with an audio and video track and |
27 // simulate that the remote peer don't support MSID. | 27 // simulate that the remote peer don't support MSID. |
28 function callWithoutMsidAndBundle() { | 28 function callWithoutMsidAndBundle() { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 gFirstConnection.onicecandidate = onIceCandidateToFirst; | 136 gFirstConnection.onicecandidate = onIceCandidateToFirst; |
137 expectEquals('stable', gFirstConnection.signalingState); | 137 expectEquals('stable', gFirstConnection.signalingState); |
138 | 138 |
139 gSecondConnection = new webkitRTCPeerConnection(null, constraints); | 139 gSecondConnection = new webkitRTCPeerConnection(null, constraints); |
140 gSecondConnection.onicecandidate = onIceCandidateToSecond; | 140 gSecondConnection.onicecandidate = onIceCandidateToSecond; |
141 gSecondConnection.onaddstream = onRemoteStream; | 141 gSecondConnection.onaddstream = onRemoteStream; |
142 } | 142 } |
143 | 143 |
144 function callUsingStream(localStream) { | 144 function callUsingStream(localStream) { |
145 gFirstConnection.addStream(localStream); | 145 gFirstConnection.addStream(localStream); |
| 146 gSecondConnection.addStream(localStream); |
146 gFirstConnection.createOffer(onOfferCreated); | 147 gFirstConnection.createOffer(onOfferCreated); |
147 } | 148 } |
148 | 149 |
149 function onOfferCreated(offer) { | 150 function onOfferCreated(offer) { |
150 gFirstConnection.setLocalDescription(offer); | 151 gFirstConnection.setLocalDescription(offer); |
151 expectEquals('have-local-offer', gFirstConnection.signalingState); | 152 expectEquals('have-local-offer', gFirstConnection.signalingState); |
152 receiveOffer(offer.sdp); | 153 receiveOffer(offer.sdp); |
153 } | 154 } |
154 | 155 |
155 function receiveOffer(offerSdp) { | 156 function receiveOffer(offerSdp) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 autoplay="autoplay"></video></td> | 278 autoplay="autoplay"></video></td> |
278 <td><canvas width="320" height="240" id="canvas"></canvas></td> | 279 <td><canvas width="320" height="240" id="canvas"></canvas></td> |
279 </tr> | 280 </tr> |
280 <tr> | 281 <tr> |
281 <td colspan="3">You should see the same animated feed in all three | 282 <td colspan="3">You should see the same animated feed in all three |
282 displays (the canvas will lag a bit). | 283 displays (the canvas will lag a bit). |
283 </td> | 284 </td> |
284 </table> | 285 </table> |
285 </body> | 286 </body> |
286 </html> | 287 </html> |
OLD | NEW |