Index: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription-promise.html |
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription-promise.html |
similarity index 61% |
copy from third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html |
copy to third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription-promise.html |
index af224ebff6b203ec8e506566a954933244725e44..f526dd84752faba689a4e37db01fb3a047aaab4e 100644 |
--- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html |
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription-promise.html |
@@ -39,14 +39,28 @@ function requestSucceeded1() |
testPassed('requestSucceeded was called.'); |
sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); |
- shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded2, requestFailed2);'); |
+ shouldNotThrow('pc.setRemoteDescription(sessionDescription).then(requestSucceeded2, requestFailed2);'); |
+} |
+ |
+function expectedTypeError(error) |
+{ |
+ window.error = error; |
+ shouldBe('error.name', '"TypeError"') |
+ testPassed('expectedTypeError was called.') |
+} |
+ |
+function expectedInvalidSessionDescription(error) |
+{ |
+ window.error = error; |
+ shouldBe('error.name', '"InvalidAccessError"') |
+ testPassed('expectedInvalidSessionDescription was called.') |
} |
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).then(requestSucceeded1, requestFailed1);'); |
window.jsTestIsAsync = true; |
window.successfullyParsed = true; |