Add IsClosed checks to various PeerConnection methods
This brings the implementations in line with the WebRTC
specification.
Bug: chromium:829238
Change-Id: I7ef64e7b6ccf0e9f60f017443565494239ff19cc
Reviewed-on: https://webrtc-review.googlesource.com/71961
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23013}
diff --git a/pc/peerconnectioninterface_unittest.cc b/pc/peerconnectioninterface_unittest.cc
index acb0dbd..0d5f177 100644
--- a/pc/peerconnectioninterface_unittest.cc
+++ b/pc/peerconnectioninterface_unittest.cc
@@ -1440,6 +1440,15 @@
EXPECT_EQ(PeerConnectionInterface::kRelay, returned_config.type);
}
+TEST_P(PeerConnectionInterfaceTest, SetConfigurationFailsAfterClose) {
+ CreatePeerConnection();
+
+ pc_->Close();
+
+ EXPECT_FALSE(
+ pc_->SetConfiguration(PeerConnectionInterface::RTCConfiguration()));
+}
+
TEST_F(PeerConnectionInterfaceTestPlanB, AddStreams) {
CreatePeerConnectionWithoutDtls();
AddVideoStream(kStreamId1);