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_common.js"></script> | 4 <script type="text/javascript" src="webrtc_test_common.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 window.onerror = function(errorMsg, url, lineNumber, column, errorObj) { | 10 window.onerror = function(errorMsg, url, lineNumber, column, errorObj) { |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 gSecondConnection.addStream(newStream); | 487 gSecondConnection.addStream(newStream); |
488 negotiate(); | 488 negotiate(); |
489 } | 489 } |
490 | 490 |
491 function negotiate() { | 491 function negotiate() { |
492 negotiateBetween(gFirstConnection, gSecondConnection); | 492 negotiateBetween(gFirstConnection, gSecondConnection); |
493 } | 493 } |
494 | 494 |
495 function iceCandidateIsLoopback(candidate) { | 495 function iceCandidateIsLoopback(candidate) { |
496 return candidate.candidate.indexOf("127.0.0.1") > -1 || | 496 return candidate.candidate.indexOf("127.0.0.1") > -1 || |
497 candidate.candidate.indexOf("::1") > -1; | 497 candidate.candidate.indexOf(" ::1 ") > -1; |
498 } | 498 } |
499 | 499 |
500 // Helper function to invoke |callback| when gathering is completed. | 500 // Helper function to invoke |callback| when gathering is completed. |
501 function gatherIceCandidates(pc, callback) { | 501 function gatherIceCandidates(pc, callback) { |
502 var candidates = []; | 502 var candidates = []; |
503 pc.createDataChannel(""); | 503 pc.createDataChannel(""); |
504 pc.onicecandidate = function(event) { | 504 pc.onicecandidate = function(event) { |
505 // null candidate indicates the gathering has completed. | 505 // null candidate indicates the gathering has completed. |
506 if (event.candidate == null) { | 506 if (event.candidate == null) { |
507 callback(candidates); | 507 callback(candidates); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 | 543 |
544 function callAndExpectNonLoopbackCandidates() { | 544 function callAndExpectNonLoopbackCandidates() { |
545 var pc = new webkitRTCPeerConnection(null, null); | 545 var pc = new webkitRTCPeerConnection(null, null); |
546 gatherIceCandidates(pc, function(candidates) { | 546 gatherIceCandidates(pc, function(candidates) { |
547 var hasCandidate = false; | 547 var hasCandidate = false; |
548 assertEquals(candidates.length > 0, true); | 548 assertEquals(candidates.length > 0, true); |
549 for (i = 0; i < candidates.length; i++) { | 549 for (i = 0; i < candidates.length; i++) { |
550 hasCandidate = true; | 550 hasCandidate = true; |
551 assertEquals(iceCandidateIsLoopback(candidates[i]), false); | 551 assertEquals(iceCandidateIsLoopback(candidates[i]), false); |
552 } | 552 } |
553 assertTrue(hasCandidate, 'expect to see at least one non-loopback candidat
e'); | 553 assertTrue(hasCandidate, 'expect to see at least one candidate'); |
554 reportTestSuccess(); | 554 reportTestSuccess(); |
555 }); | 555 }); |
556 } | 556 } |
557 | 557 |
558 function removeMsid(offerSdp) { | 558 function removeMsid(offerSdp) { |
559 offerSdp = offerSdp.replace(/a=msid-semantic.*\r\n/g, ''); | 559 offerSdp = offerSdp.replace(/a=msid-semantic.*\r\n/g, ''); |
560 offerSdp = offerSdp.replace('a=mid:audio\r\n', ''); | 560 offerSdp = offerSdp.replace('a=mid:audio\r\n', ''); |
561 offerSdp = offerSdp.replace('a=mid:video\r\n', ''); | 561 offerSdp = offerSdp.replace('a=mid:video\r\n', ''); |
562 offerSdp = offerSdp.replace(/a=ssrc.*\r\n/g, ''); | 562 offerSdp = offerSdp.replace(/a=ssrc.*\r\n/g, ''); |
563 return offerSdp; | 563 return offerSdp; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 <td><canvas width="320" height="240" id="remote-view-2-canvas" | 620 <td><canvas width="320" height="240" id="remote-view-2-canvas" |
621 style="display:none"></canvas></td> | 621 style="display:none"></canvas></td> |
622 <td><canvas width="320" height="240" id="remote-view-3-canvas" | 622 <td><canvas width="320" height="240" id="remote-view-3-canvas" |
623 style="display:none"></canvas></td> | 623 style="display:none"></canvas></td> |
624 <td><canvas width="320" height="240" id="remote-view-4-canvas" | 624 <td><canvas width="320" height="240" id="remote-view-4-canvas" |
625 style="display:none"></canvas></td> | 625 style="display:none"></canvas></td> |
626 </tr> | 626 </tr> |
627 </table> | 627 </table> |
628 </body> | 628 </body> |
629 </html> | 629 </html> |
OLD | NEW |