Index: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription-promise.html |
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription-promise.html |
similarity index 61% |
copy from third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription.html |
copy to third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription-promise.html |
index a8987914665129244a44fbb560021f856629ebcc..16a4405592e05c083b1617ea01dec027437ac5f2 100644 |
--- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription.html |
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription-promise.html |
@@ -39,14 +39,28 @@ function requestSucceeded1() |
testPassed('requestSucceeded was called.'); |
sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"}); |
- shouldNotThrow('pc.setLocalDescription(sessionDescription, requestSucceeded2, requestFailed2);'); |
+ shouldNotThrow('pc.setLocalDescription(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.setLocalDescription(null)'); |
+shouldNotThrow('pc.setLocalDescription().catch(expectedTypeError)'); |
+shouldNotThrow('pc.setLocalDescription(null).catch(expectedInvalidSessionDescription)'); |
var sessionDescription = new RTCSessionDescription({type:"offer", sdp:"local"}); |
-shouldNotThrow('pc.setLocalDescription(sessionDescription, requestSucceeded1, requestFailed1);'); |
- |
+shouldNotThrow('pc.setLocalDescription(sessionDescription).then(requestSucceeded1, requestFailed1);'); |
window.jsTestIsAsync = true; |
window.successfullyParsed = true; |