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

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

Issue 1713953002: Report errors in RTCPeerConnection legacy functions via the the failure callback instead of excepti… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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-createAnswer-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-createAnswer.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html
index d7683765f7ad29c1d928f4e602b2d035de9e416b..64fb888b6caba2ff92a4db73be5f615c0f67c4ab 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html
@@ -9,50 +9,53 @@ description("Tests RTCPeerConnection createAnswer.");
var pc = null;
-function requestFailed3(error)
+function unexpectedCallback()
{
- testFailed('createAnswer request failed.');
-
+ testFailed('unexpectedCallback was called')
finishJSTest();
}
-function requestSucceeded3()
+function answerCreated()
{
testPassed('createAnswer request succeeded.');
-
- finishJSTest();
-}
-
-function requestFailed2(error)
-{
- testFailed('setRemoteDescription request failed.');
-
finishJSTest();
}
-function requestSucceeded2()
+function descriptionSet()
{
testPassed('setRemoteDescription request succeeded.');
-
- shouldNotThrow('pc.createAnswer(requestSucceeded3, requestFailed3);');
+ shouldNotThrow('pc.createAnswer(answerCreated, unexpectedCallback);');
}
-function requestFailed1()
+function createOfferWithoutDescriptionFailed()
{
- testPassed('createOffer request failed.');
-
+ testPassed('createOffer request without remote description failed.');
sessionDescription = new RTCSessionDescription({type:"answer", sdp:"remote"});
- shouldNotThrow('pc.setRemoteDescription(sessionDescription, requestSucceeded2, requestFailed2);');
+ shouldNotThrow('pc.setRemoteDescription(sessionDescription, descriptionSet, unexpectedCallback);');
}
-function requestSucceeded1(sd)
+function testExecutionOrderClosedConnection()
{
- testFailed('createOffer request succeeded.');
- finishJSTest();
+ var localPeerConnection = new webkitRTCPeerConnection(null, null);
+ localPeerConnection.close();
+ var counter = 0;
+ window.events = [];
+ Promise.resolve().then(_ => window.events[counter++] = 1);
+ localPeerConnection.createAnswer(unexpectedCallback, error => {
+ window.error = error;
+ shouldBe('error.name', '"InvalidStateError"');
+ shouldBe('error.toString()', '"InvalidStateError: The RTCPeerConnection\'s signalingState is \'closed\'."');
+ window.events[counter++] = 2;
+ });
+ Promise.resolve().then(_ => {
+ window.events[counter++] = 3;
+ shouldBe('events', '[1,2,3]');
+ });
}
+shouldNotThrow('testExecutionOrderClosedConnection()');
pc = new webkitRTCPeerConnection(null, null);
-pc.createOffer(requestSucceeded1, requestFailed1);
+pc.createOffer(unexpectedCallback, createOfferWithoutDescriptionFailed);
window.jsTestIsAsync = true;
window.successfullyParsed = true;
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698