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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html
index f144b9dacfd2914c80f0bf16aa68e458ad49eaf0..ef99d222d1980b65735554ad0bf050f59b1b8ed2 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice.html
@@ -25,24 +25,50 @@ function addIceCandidateSuccess()
pc.close();
}
-function addIceCandidateFailure()
+function unexpectedCallback()
{
- testFailed("addIceCandidateFailue was called.");
+ testFailed("unexpectedCallback was called.");
finishJSTest();
}
+function expectedTypeError(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, addIceCandidateSuccess, unexpectedCallback).catch(expectedTypeError);');
+ shouldNotThrow('pc.addIceCandidate(iceCandidate, null, unexpectedCallback).catch(expectedTypeError);');
+ shouldNotThrow('pc.addIceCandidate(iceCandidate, addIceCandidateSuccess, null).catch(expectedTypeError);');
+ shouldNotThrow('pc.addIceCandidate(iceCandidate, addIceCandidateSuccess, unexpectedCallback);');
}
}
+function testExecutionOrderClosedConnection()
+{
+ var localPeerConnection = new webkitRTCPeerConnection(null, null);
+ localPeerConnection.close();
+ var counter = 0;
+ events = [];
philipj_slow 2016/02/18 14:39:07 could set window.events for clarity, like window.e
+ Promise.resolve().then(_ => events[counter++] = 1);
+ var iceCandidate = new RTCIceCandidate({candidate:"nano nano"});
+ localPeerConnection.addIceCandidate(iceCandidate, unexpectedCallback, (error) => {
+ window.error = error;
+ shouldBe('error', '"The RTCPeerConnection\'s signalingState is \'closed\'."');
+ events[counter++] = 2;
+ });
+ Promise.resolve().then(_ => {
+ events[counter++] = 3;
+ shouldBe('events', '[1,2,3]');
philipj_slow 2016/02/18 14:39:07 Looks good!
+ });
+}
+
+shouldNotThrow('testExecutionOrderClosedConnection()');
shouldNotThrow('pc = new webkitRTCPeerConnection(null, null);');
pc.oniceconnectionstatechange = onIceChange1;
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-ice-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698