| 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 RTCPeerConnection remoteDescription."); | 8 description("Tests RTCPeerConnection remoteDescription."); | 
| 9 | 9 | 
| 10 var pc = null; | 10 var pc = null; | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 32 { | 32 { | 
| 33     testFailed('requestFailed was called.'); | 33     testFailed('requestFailed was called.'); | 
| 34     finishJSTest(); | 34     finishJSTest(); | 
| 35 } | 35 } | 
| 36 | 36 | 
| 37 function requestSucceeded1() | 37 function requestSucceeded1() | 
| 38 { | 38 { | 
| 39     testPassed('requestSucceeded was called.'); | 39     testPassed('requestSucceeded was called.'); | 
| 40 | 40 | 
| 41     sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); | 41     sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); | 
| 42     shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded
    2, requestFailed2);'); | 42     shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucc
    eeded2, requestFailed2);'); | 
|  | 43 } | 
|  | 44 | 
|  | 45 function expectedTypeError(error) | 
|  | 46 { | 
|  | 47     errorReason = error; | 
|  | 48     shouldBe('errorReason.name', '"TypeError"') | 
|  | 49     testPassed('expectedTypeError was called.') | 
|  | 50 } | 
|  | 51 | 
|  | 52 function expectedInvalidSessionDescription(error) | 
|  | 53 { | 
|  | 54     errorReason = error; | 
|  | 55     shouldBe('errorReason.name', '"InvalidSessionDescription"') | 
|  | 56     testPassed('expectedInvalidSessionDescription was called.') | 
| 43 } | 57 } | 
| 44 | 58 | 
| 45 pc = new webkitRTCPeerConnection(null, null); | 59 pc = new webkitRTCPeerConnection(null, null); | 
| 46 shouldThrow('pc.setRemoteDescription(null)'); | 60 shouldNotThrow('pc.setRemoteDescription().catch(expectedTypeError)'); | 
|  | 61 shouldNotThrow('pc.setRemoteDescription(null).catch(expectedInvalidSessionDescri
    ption)'); | 
| 47 var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"}
    ); | 62 var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"}
    ); | 
| 48 shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded1, r
    equestFailed1);'); | 63 shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceede
    d1, requestFailed1);'); | 
| 49 |  | 
| 50 | 64 | 
| 51 window.jsTestIsAsync = true; | 65 window.jsTestIsAsync = true; | 
| 52 window.successfullyParsed = true; | 66 window.successfullyParsed = true; | 
| 53 </script> | 67 </script> | 
| 54 </body> | 68 </body> | 
| 55 </html> | 69 </html> | 
| OLD | NEW | 
|---|