| 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 localDescription."); | 8 description("Tests RTCPeerConnection localDescription."); |
| 9 | 9 |
| 10 var pc = null; | 10 var pc = null; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 function expectedTypeError(error) | 45 function expectedTypeError(error) |
| 46 { | 46 { |
| 47 window.error = error; | 47 window.error = error; |
| 48 shouldBe('error.name', '"TypeError"') | 48 shouldBe('error.name', '"TypeError"') |
| 49 testPassed('expectedTypeError was called.') | 49 testPassed('expectedTypeError was called.') |
| 50 } | 50 } |
| 51 | 51 |
| 52 function expectedInvalidSessionDescription(error) | 52 function expectedInvalidSessionDescription(error) |
| 53 { | 53 { |
| 54 window.error = error; | 54 window.error = error; |
| 55 shouldBe('error.name', '"InvalidAccessError"') | 55 shouldBe('error.name', '"OperationError"') |
| 56 testPassed('expectedInvalidSessionDescription was called.') | 56 testPassed('expectedInvalidSessionDescription was called.') |
| 57 } | 57 } |
| 58 | 58 |
| 59 pc = new webkitRTCPeerConnection(null, null); | 59 pc = new webkitRTCPeerConnection(null, null); |
| 60 shouldNotThrow('pc.setLocalDescription().catch(expectedTypeError)'); | 60 shouldNotThrow('pc.setLocalDescription().catch(expectedTypeError)'); |
| 61 shouldNotThrow('pc.setLocalDescription(null).catch(expectedInvalidSessionDescrip
tion)'); | 61 shouldNotThrow('pc.setLocalDescription(null).catch(expectedInvalidSessionDescrip
tion)'); |
| 62 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); | 62 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); |
| 63 shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded
1, requestFailed1);'); | 63 shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded
1, requestFailed1);'); |
| 64 | 64 |
| 65 window.jsTestIsAsync = true; | 65 window.jsTestIsAsync = true; |
| 66 window.successfullyParsed = true; | 66 window.successfullyParsed = true; |
| 67 </script> | 67 </script> |
| 68 </body> | 68 </body> |
| 69 </html> | 69 </html> |
| OLD | NEW |