Commit 61ac0d3b authored by tommi's avatar tommi Committed by Commit bot

Fix state checking of signalingState in peerconnection-call.html

and also create an answer when setting the remote description has completed.

BUG=369796

Review URL: https://codereview.chromium.org/683433004

Cr-Commit-Position: refs/heads/master@{#301425}
parent c5b11ef4
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
return document.getElementById(id); return document.getElementById(id);
}; };
window.onerror = function(errorMsg, url, lineNumber, column, errorObj) {
failTest('Error: ' + errorMsg + '\nScript: ' + url +
'\nLine: ' + lineNumber + '\nColumn: ' + column +
'\nStackTrace: ' + errorObj);
}
var gFirstConnection = null; var gFirstConnection = null;
var gSecondConnection = null; var gSecondConnection = null;
var gTestWithoutMsid = false; var gTestWithoutMsid = false;
...@@ -282,7 +288,6 @@ ...@@ -282,7 +288,6 @@
waitForVideo('remote-view-2'); waitForVideo('remote-view-2');
} }
// Test call with a data channel and later add audio and video. // Test call with a data channel and later add audio and video.
function callWithDataAndLaterAddMedia() { function callWithDataAndLaterAddMedia() {
createConnections({optional:[{RtpDataChannels: true}]}); createConnections({optional:[{RtpDataChannels: true}]});
...@@ -628,7 +633,6 @@ ...@@ -628,7 +633,6 @@
firstDataChannel.send(sendDataString); firstDataChannel.send(sendDataString);
} }
// Event handler for when |gSecondConnection| receive a new dataChannel. // Event handler for when |gSecondConnection| receive a new dataChannel.
gSecondConnection.ondatachannel = function (event) { gSecondConnection.ondatachannel = function (event) {
var secondDataChannel = event.channel; var secondDataChannel = event.channel;
...@@ -803,12 +807,16 @@ ...@@ -803,12 +807,16 @@
var parsedOffer = new RTCSessionDescription({ type: 'offer', var parsedOffer = new RTCSessionDescription({ type: 'offer',
sdp: offerSdp }); sdp: offerSdp });
callee.setRemoteDescription(parsedOffer, function() {}, callee.setRemoteDescription(parsedOffer,
onRemoteDescriptionError); function() {
callee.createAnswer(function (answer) { assertEquals('have-remote-offer',
callee.signalingState);
callee.createAnswer(
function (answer) {
onAnswerCreated(answer, caller, callee); onAnswerCreated(answer, caller, callee);
}); });
assertEquals('have-remote-offer', callee.signalingState); },
onRemoteDescriptionError);
} }
function removeMsid(offerSdp) { function removeMsid(offerSdp) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment