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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 function expectedInvalidSessionDescription(error) | 46 function expectedInvalidSessionDescription(error) |
47 { | 47 { |
48 testPassed('expectedInvalidSessionDescription was called.') | 48 testPassed('expectedInvalidSessionDescription was called.') |
49 } | 49 } |
50 | 50 |
51 function testExecutionOrderClosedConnection() | 51 function testExecutionOrderClosedConnection() |
52 { | 52 { |
53 var localPeerConnection = new webkitRTCPeerConnection(null, null); | 53 var localPeerConnection = new webkitRTCPeerConnection(null, null); |
54 localPeerConnection.close(); | 54 localPeerConnection.close(); |
55 var counter = 0; | 55 var counter = 0; |
56 events = []; | 56 window.events = []; |
57 Promise.resolve().then(_ => events[counter++] = 1); | 57 Promise.resolve().then(_ => events[counter++] = 1); |
58 var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remo
te"}); | 58 var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remo
te"}); |
59 localPeerConnection.setRemoteDescription(sessionDescription, unexpectedCallb
ack, (error) => { | 59 localPeerConnection.setRemoteDescription(sessionDescription, unexpectedCallb
ack, (reason) => { |
60 window.error = error; | 60 window.error = reason; |
61 shouldBe('error', '"The RTCPeerConnection\'s signalingState is \'closed\
'."'); | 61 shouldBe('error.name', '"InvalidStateError"'); |
62 events[counter++] = 2; | 62 events[counter++] = 2; |
63 }); | 63 }); |
64 Promise.resolve().then(_ => { | 64 Promise.resolve().then(_ => { |
65 events[counter++] = 3; | 65 events[counter++] = 3; |
66 shouldBe('events', '[1,2,3]'); | 66 shouldBe('events', '[1,2,3]'); |
67 }); | 67 }); |
68 } | 68 } |
69 | 69 |
70 shouldNotThrow('testExecutionOrderClosedConnection()'); | 70 shouldNotThrow('testExecutionOrderClosedConnection()'); |
71 pc = new webkitRTCPeerConnection(null, null); | 71 pc = new webkitRTCPeerConnection(null, null); |
72 shouldNotThrow('pc.setRemoteDescription().catch(expectedTypeError)'); | 72 shouldNotThrow('pc.setRemoteDescription().catch(expectedTypeError)'); |
73 shouldNotThrow('pc.setRemoteDescription(null).catch(expectedInvalidSessionDescri
ption)'); | 73 shouldNotThrow('pc.setRemoteDescription(null).catch(expectedInvalidSessionDescri
ption)'); |
74 var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"}
); | 74 var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"}
); |
75 shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded1, u
nexpectedCallback);'); | 75 shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded1, u
nexpectedCallback);'); |
76 | 76 |
77 window.jsTestIsAsync = true; | 77 window.jsTestIsAsync = true; |
78 window.successfullyParsed = true; | 78 window.successfullyParsed = true; |
79 </script> | 79 </script> |
80 </body> | 80 </body> |
81 </html> | 81 </html> |
OLD | NEW |