Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-promise.html

Issue 1661493002: Add promise-based addIceCandidate, setLocalDescription and setRemoteDescription to RTCPeerConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: philipj's comments on tests Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-promise.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-promise.html
similarity index 66%
copy from third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html
copy to third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-promise.html
index f144b9dacfd2914c80f0bf16aa68e458ad49eaf0..b89bbbe4e5ae798fcd1ff6d08cd76fe9ea22f374 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-promise.html
@@ -27,19 +27,30 @@ function addIceCandidateSuccess()
function addIceCandidateFailure()
{
- testFailed("addIceCandidateFailue was called.");
+ testFailed("addIceCandidateFailure was called.");
finishJSTest();
}
+function unexpectedSuccess()
+{
+ testFailed("unexpectedSuccess was called.");
+ finishJSTest();
+}
+
+function expectedTypeError(error)
+{
+ window.error = error;
+ shouldBe('error.name', '"TypeError"')
+ testPassed('expectedTypeError was called.')
+}
+
function onIceChange1()
{
if (pc.iceConnectionState === "completed") {
testPassed("iceConnectionState is completed");
iceCandidate = new RTCIceCandidate({candidate:"nano nano"});
- shouldThrow('pc.addIceCandidate(null, addIceCandidateSuccess, addIceCandidateFailure);');
- shouldThrow('pc.addIceCandidate(iceCandidate, null, addIceCandidateFailure);');
- shouldThrow('pc.addIceCandidate(iceCandidate, addIceCandidateSuccess, null);');
- shouldNotThrow('pc.addIceCandidate(iceCandidate, addIceCandidateSuccess, addIceCandidateFailure);');
+ shouldNotThrow('pc.addIceCandidate(null).then(unexpectedSuccess, expectedTypeError);');
+ shouldNotThrow('pc.addIceCandidate(iceCandidate).then(addIceCandidateSuccess, addIceCandidateFailure);');
}
}

Powered by Google App Engine
This is Rietveld 408576698