| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 description("Tests that an RTCPeerConnection can signal that remote streams are
added and removed."); | 8 description("Tests that an RTCPeerConnection can signal that remote streams are
added and removed."); |
| 9 | 9 |
| 10 var pc = null; | 10 var pc = null; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 pc.addStream(local_stream); | 51 pc.addStream(local_stream); |
| 52 | 52 |
| 53 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"}
); | 53 sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"}
); |
| 54 shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded
1, requestFailedUnexpectedly);'); | 54 shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded
1, requestFailedUnexpectedly);'); |
| 55 } | 55 } |
| 56 | 56 |
| 57 function onAddStream(event) { | 57 function onAddStream(event) { |
| 58 testPassed('remote stream was added'); | 58 testPassed('remote stream was added'); |
| 59 shouldBeEqualToNumber('event.stream.getVideoTracks().length', 1); | 59 shouldBeEqualToNumber('event.stream.getVideoTracks().length', 1); |
| 60 shouldBeEqualToNumber('event.stream.getAudioTracks().length', 1); | 60 shouldBeEqualToNumber('event.stream.getAudioTracks().length', 1); |
| 61 shouldBeTrue('event.stream.active') |
| 61 pc.removeStream(local_stream); | 62 pc.removeStream(local_stream); |
| 62 } | 63 } |
| 63 | 64 |
| 64 function onRemoveStream(event) { | 65 function onRemoveStream(event) { |
| 65 testPassed('remote stream was removed'); | 66 testPassed('remote stream was removed'); |
| 66 shouldBeEqualToNumber('event.stream.getVideoTracks().length', 0); | 67 shouldBeEqualToNumber('event.stream.getVideoTracks().length', 0); |
| 67 shouldBeEqualToNumber('event.stream.getAudioTracks().length', 0); | 68 shouldBeEqualToNumber('event.stream.getAudioTracks().length', 0); |
| 69 shouldBeFalse('event.stream.active') |
| 68 } | 70 } |
| 69 | 71 |
| 70 pc = new webkitRTCPeerConnection(null, null); | 72 pc = new webkitRTCPeerConnection(null, null); |
| 71 pc.onaddstream = onAddStream; | 73 pc.onaddstream = onAddStream; |
| 72 pc.onremovestream = onRemoveStream; | 74 pc.onremovestream = onRemoveStream; |
| 73 getUserMedia({audio:true, video:true}, gotStream); | 75 getUserMedia({audio:true, video:true}, gotStream); |
| 74 | 76 |
| 75 | 77 |
| 76 window.jsTestIsAsync = true; | 78 window.jsTestIsAsync = true; |
| 77 window.successfullyParsed = true; | 79 window.successfullyParsed = true; |
| 78 </script> | 80 </script> |
| 79 </body> | 81 </body> |
| 80 </html> | 82 </html> |
| OLD | NEW |