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 | 45 |
46 function expectedInvalidSessionDescription(error) | 46 function expectedInvalidSessionDescription(error) |
47 { | 47 { |
48 window.error = error; | 48 window.error = error; |
49 shouldBe('error.name', '"OperationError"'); | 49 shouldBe('error.name', '"OperationError"'); |
50 testPassed('expectedInvalidSessionDescription was called.'); | 50 testPassed('expectedInvalidSessionDescription was called.'); |
51 } | 51 } |
52 | 52 |
53 function testExecutionOrderClosedConnection() | 53 function testExecutionOrderClosedConnection() |
54 { | 54 { |
55 var localPeerConnection = new webkitRTCPeerConnection(null, null); | 55 var localPeerConnection = new RTCPeerConnection(); |
56 localPeerConnection.close(); | 56 localPeerConnection.close(); |
57 var counter = 0; | 57 var counter = 0; |
58 window.events = []; | 58 window.events = []; |
59 Promise.resolve().then(_ => events[counter++] = 1); | 59 Promise.resolve().then(_ => events[counter++] = 1); |
60 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local
"}); | 60 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local
"}); |
61 localPeerConnection.setLocalDescription(sessionDescription, unexpectedCallba
ck, error => { | 61 localPeerConnection.setLocalDescription(sessionDescription, unexpectedCallba
ck, error => { |
62 window.error = error; | 62 window.error = error; |
63 shouldBe('error.name', '"InvalidStateError"'); | 63 shouldBe('error.name', '"InvalidStateError"'); |
64 shouldBe('error.toString()', '"InvalidStateError: The RTCPeerConnection\
's signalingState is \'closed\'."'); | 64 shouldBe('error.toString()', '"InvalidStateError: The RTCPeerConnection\
's signalingState is \'closed\'."'); |
65 events[counter++] = 2; | 65 events[counter++] = 2; |
66 }); | 66 }); |
67 Promise.resolve().then(_ => { | 67 Promise.resolve().then(_ => { |
68 events[counter++] = 3; | 68 events[counter++] = 3; |
69 shouldBe('events', '[1,2,3]'); | 69 shouldBe('events', '[1,2,3]'); |
70 }); | 70 }); |
71 } | 71 } |
72 | 72 |
73 shouldNotThrow('testExecutionOrderClosedConnection()'); | 73 shouldNotThrow('testExecutionOrderClosedConnection()'); |
74 pc = new webkitRTCPeerConnection(null, null); | 74 pc = new RTCPeerConnection(); |
75 shouldNotThrow('pc.setLocalDescription().catch(expectedTypeError)'); | 75 shouldNotThrow('pc.setLocalDescription().catch(expectedTypeError)'); |
76 shouldNotThrow('pc.setLocalDescription(null).catch(expectedInvalidSessionDescrip
tion)'); | 76 shouldNotThrow('pc.setLocalDescription(null).catch(expectedInvalidSessionDescrip
tion)'); |
77 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); | 77 var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); |
78 shouldNotThrow('pc.setLocalDescription(sessionDescription, requestSucceeded1, un
expectedCallback);'); | 78 shouldNotThrow('pc.setLocalDescription(sessionDescription, requestSucceeded1, un
expectedCallback);'); |
79 | 79 |
80 window.jsTestIsAsync = true; | 80 window.jsTestIsAsync = true; |
81 window.successfullyParsed = true; | 81 window.successfullyParsed = true; |
82 </script> | 82 </script> |
83 </body> | 83 </body> |
84 </html> | 84 </html> |
OLD | NEW |