Commit aa899fbe authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Remove checks for state in setLocalDescription

Proper state checking requires the operations queue,
so disabling for now.

Bug: 826194
Change-Id: I48b27834f93e3d01665dcb3c96ddd94ef0589944
Reviewed-on: https://chromium-review.googlesource.com/980945Reviewed-by: default avatarTommi <tommi@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546231}
parent 9ea05472
This is a testharness.js-based test. This is a testharness.js-based test.
PASS setLocalDescription(pranswer) from stable state should reject with InvalidStateError FAIL setLocalDescription(pranswer) from stable state should reject with InvalidStateError assert_throws: function "function() { throw e }" threw object "OperationError: Failed to set local pranswer sdp: Called in wrong state: kStable" that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
FAIL setLocalDescription(pranswer) should succeed assert_not_equals: Expect session description to be defined got disallowed value undefined FAIL setLocalDescription(pranswer) should succeed assert_not_equals: Expect session description to be defined got disallowed value undefined
PASS setLocalDescription(pranswer) can be applied multiple times while still in have-local-pranswer PASS setLocalDescription(pranswer) can be applied multiple times while still in have-local-pranswer
FAIL setLocalDescription(answer) from have-local-pranswer state should succeed assert_not_equals: Expect session description to be defined got disallowed value undefined FAIL setLocalDescription(answer) from have-local-pranswer state should succeed assert_not_equals: Expect session description to be defined got disallowed value undefined
......
...@@ -119,12 +119,6 @@ namespace { ...@@ -119,12 +119,6 @@ namespace {
const char kSignalingStateClosedMessage[] = const char kSignalingStateClosedMessage[] =
"The RTCPeerConnection's signalingState is 'closed'."; "The RTCPeerConnection's signalingState is 'closed'.";
const char kSignalingStatePreventsOfferMessage[] =
"The RTCPeerConnection's signalingState must be 'stable' or "
"'have-local-offer' to apply an offer";
const char kSignalingStatePreventsAnswerMessage[] =
"The RTCPeerConnection's signalingState must be 'have-remote-offer' or "
"'have-local-pranswer' to apply an answer";
const char kModifiedSdpMessage[] = const char kModifiedSdpMessage[] =
"The SDP does not match the previously generated SDP for this type"; "The SDP does not match the previously generated SDP for this type";
...@@ -750,11 +744,6 @@ DOMException* RTCPeerConnection::checkSdpForStateErrors( ...@@ -750,11 +744,6 @@ DOMException* RTCPeerConnection::checkSdpForStateErrors(
*sdp = session_description_init.sdp(); *sdp = session_description_init.sdp();
if (session_description_init.type() == "offer") { if (session_description_init.type() == "offer") {
if (signaling_state_ != kSignalingStateStable &&
signaling_state_ != kSignalingStateHaveLocalOffer) {
return DOMException::Create(kInvalidStateError,
kSignalingStatePreventsOfferMessage);
}
if (sdp->IsNull() || sdp->IsEmpty()) { if (sdp->IsNull() || sdp->IsEmpty()) {
*sdp = last_offer_; *sdp = last_offer_;
} else if (session_description_init.sdp() != last_offer_) { } else if (session_description_init.sdp() != last_offer_) {
...@@ -769,11 +758,6 @@ DOMException* RTCPeerConnection::checkSdpForStateErrors( ...@@ -769,11 +758,6 @@ DOMException* RTCPeerConnection::checkSdpForStateErrors(
} }
} else if (session_description_init.type() == "answer" || } else if (session_description_init.type() == "answer" ||
session_description_init.type() == "pranswer") { session_description_init.type() == "pranswer") {
if (signaling_state_ != kSignalingStateHaveRemoteOffer &&
signaling_state_ != kSignalingStateHaveLocalPrAnswer) {
return DOMException::Create(kInvalidStateError,
kSignalingStatePreventsAnswerMessage);
}
if (sdp->IsNull() || sdp->IsEmpty()) { if (sdp->IsNull() || sdp->IsEmpty()) {
*sdp = last_answer_; *sdp = last_answer_;
} else if (session_description_init.sdp() != last_answer_) { } else if (session_description_init.sdp() != last_answer_) {
......
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