| 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 window.onerror = function(errorMsg, url, lineNumber, column, errorObj) { | 10 window.onerror = function(errorMsg, url, lineNumber, column, errorObj) { |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 | 608 |
| 609 // When |firstDataChannel| transition to closed state, the test pass. | 609 // When |firstDataChannel| transition to closed state, the test pass. |
| 610 addExpectedEvent(); | 610 addExpectedEvent(); |
| 611 firstDataChannel.onclose = function() { | 611 firstDataChannel.onclose = function() { |
| 612 assertEquals('closed', firstDataChannel.readyState); | 612 assertEquals('closed', firstDataChannel.readyState); |
| 613 eventOccured(); | 613 eventOccured(); |
| 614 } | 614 } |
| 615 | 615 |
| 616 // Event handler for when |gSecondConnection| receive a new dataChannel. | 616 // Event handler for when |gSecondConnection| receive a new dataChannel. |
| 617 gSecondConnection.ondatachannel = function (event) { | 617 gSecondConnection.ondatachannel = function (event) { |
| 618 var secondDataChannel = event.channel; | 618 // Make secondDataChannel global to make sure it's not gc'd. |
| 619 secondDataChannel = event.channel; |
| 619 | 620 |
| 620 // When |secondDataChannel| receive a message, send a message back. | 621 // When |secondDataChannel| receive a message, send a message back. |
| 621 secondDataChannel.onmessage = function(event) { | 622 secondDataChannel.onmessage = function(event) { |
| 622 assertEquals(event.data, sendDataString); | 623 assertEquals(event.data, sendDataString); |
| 623 console.log("gSecondConnection received data"); | 624 console.log("gSecondConnection received data"); |
| 624 assertEquals('open', secondDataChannel.readyState); | 625 assertEquals('open', secondDataChannel.readyState); |
| 625 secondDataChannel.send(sendDataString); | 626 secondDataChannel.send(sendDataString); |
| 626 } | 627 } |
| 627 } | 628 } |
| 628 } | 629 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 646 // When |firstDataChannel| receive a message, send message back. | 647 // When |firstDataChannel| receive a message, send message back. |
| 647 // initiate a new offer/answer exchange to complete the closure. | 648 // initiate a new offer/answer exchange to complete the closure. |
| 648 firstDataChannel.onmessage = function(event) { | 649 firstDataChannel.onmessage = function(event) { |
| 649 assertEquals('open', firstDataChannel.readyState); | 650 assertEquals('open', firstDataChannel.readyState); |
| 650 assertEquals(event.data, sendDataString); | 651 assertEquals(event.data, sendDataString); |
| 651 firstDataChannel.send(sendDataString); | 652 firstDataChannel.send(sendDataString); |
| 652 } | 653 } |
| 653 | 654 |
| 654 // Event handler for when |gSecondConnection| receive a new dataChannel. | 655 // Event handler for when |gSecondConnection| receive a new dataChannel. |
| 655 gSecondConnection.ondatachannel = function (event) { | 656 gSecondConnection.ondatachannel = function (event) { |
| 656 var secondDataChannel = event.channel; | 657 // Make secondDataChannel global to make sure it's not gc'd. |
| 658 secondDataChannel = event.channel; |
| 657 secondDataChannel.onopen = function() { | 659 secondDataChannel.onopen = function() { |
| 658 secondDataChannel.send(sendDataString); | 660 secondDataChannel.send(sendDataString); |
| 659 } | 661 } |
| 660 | 662 |
| 661 // When |secondDataChannel| receive a message, close the channel and | 663 // When |secondDataChannel| receive a message, close the channel and |
| 662 // initiate a new offer/answer exchange to complete the closure. | 664 // initiate a new offer/answer exchange to complete the closure. |
| 663 secondDataChannel.onmessage = function(event) { | 665 secondDataChannel.onmessage = function(event) { |
| 664 assertEquals(event.data, sendDataString); | 666 assertEquals(event.data, sendDataString); |
| 665 assertEquals('open', secondDataChannel.readyState); | 667 assertEquals('open', secondDataChannel.readyState); |
| 666 secondDataChannel.close(); | 668 secondDataChannel.close(); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 <td><canvas width="320" height="240" id="remote-view-2-canvas" | 955 <td><canvas width="320" height="240" id="remote-view-2-canvas" |
| 954 style="display:none"></canvas></td> | 956 style="display:none"></canvas></td> |
| 955 <td><canvas width="320" height="240" id="remote-view-3-canvas" | 957 <td><canvas width="320" height="240" id="remote-view-3-canvas" |
| 956 style="display:none"></canvas></td> | 958 style="display:none"></canvas></td> |
| 957 <td><canvas width="320" height="240" id="remote-view-4-canvas" | 959 <td><canvas width="320" height="240" id="remote-view-4-canvas" |
| 958 style="display:none"></canvas></td> | 960 style="display:none"></canvas></td> |
| 959 </tr> | 961 </tr> |
| 960 </table> | 962 </table> |
| 961 </body> | 963 </body> |
| 962 </html> | 964 </html> |
| OLD | NEW |