| Index: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html
|
| index af224ebff6b203ec8e506566a954933244725e44..ac0165f99204b77be6ea522739384638457d84d8 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html
|
| @@ -22,31 +22,64 @@ function requestFailed2()
|
| finishJSTest();
|
| }
|
|
|
| -function requestSucceeded2()
|
| +function requestSucceeded1()
|
| {
|
| - testFailed('requestSucceeded was called.');
|
| - finishJSTest();
|
| + testPassed('requestSucceeded was called.');
|
| +
|
| + sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
|
| + shouldNotThrow('pc.setRemoteDescription(sessionDescription, unexpectedCallback, requestFailed2);');
|
| }
|
|
|
| -function requestFailed1()
|
| +function unexpectedCallback()
|
| {
|
| - testFailed('requestFailed was called.');
|
| + testFailed('unexpectedCallback was called.');
|
| finishJSTest();
|
| }
|
|
|
| -function requestSucceeded1()
|
| +function expectedTypeError(error)
|
| {
|
| - testPassed('requestSucceeded was called.');
|
| + window.error = error;
|
| + shouldBe('error.name', '"TypeError"')
|
| + testPassed('expectedTypeError was called.')
|
| +}
|
|
|
| - sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"});
|
| - shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded2, requestFailed2);');
|
| +function expectedInvalidSessionDescription(error)
|
| +{
|
| + testPassed('expectedInvalidSessionDescription was called.')
|
| }
|
|
|
| +function testExecutionOrderClosedConnection()
|
| +{
|
| + var localPeerConnection = new webkitRTCPeerConnection(null, null);
|
| + orderCounter = 0;
|
| + localPeerConnection.setRemoteDescription().catch(function(error) {
|
| + window.error = error;
|
| + shouldBe('error.name', '"TypeError"');
|
| + orderCounter++;
|
| + shouldBeEqualToNumber('orderCounter', 1)
|
| + })
|
| + localPeerConnection.close();
|
| + var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
|
| + localPeerConnection.setRemoteDescription(sessionDescription, unexpectedCallback, function(error) {
|
| + window.error = error;
|
| + shouldBe('error', '"The RTCPeerConnection\'s signalingState is \'closed\'."');
|
| + orderCounter++;
|
| + shouldBeEqualToNumber('orderCounter', 2);
|
| + });
|
| + localPeerConnection.setRemoteDescription().catch(function(error) {
|
| + window.error = error;
|
| + shouldBe('error.name', '"TypeError"');
|
| + orderCounter++;
|
| + shouldBeEqualToNumber('orderCounter', 3)
|
| + });
|
| +}
|
| +
|
| +shouldNotThrow('testExecutionOrderClosedConnection()');
|
| pc = new webkitRTCPeerConnection(null, null);
|
| -shouldThrow('pc.setRemoteDescription(null)');
|
| +shouldNotThrow('pc.setRemoteDescription().catch(expectedTypeError)');
|
| +shouldNotThrow('pc.setRemoteDescription(null).catch(expectedInvalidSessionDescription)');
|
| var sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
|
| -shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded1, requestFailed1);');
|
| -
|
| +shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded1, unexpectedCallback);');
|
|
|
| window.jsTestIsAsync = true;
|
| window.successfullyParsed = true;
|
|
|