Adding GetConfiguration to PeerConnection.

Just returns the configuration the PC was constructed with, or the last
one passed into SetConfiguration.

BUG=chromium:587453

Review-Url: https://codereview.webrtc.org/2504103002
Cr-Commit-Position: refs/heads/master@{#15111}
diff --git a/webrtc/api/peerconnectioninterface_unittest.cc b/webrtc/api/peerconnectioninterface_unittest.cc
index be4dc06..245e81c 100644
--- a/webrtc/api/peerconnectioninterface_unittest.cc
+++ b/webrtc/api/peerconnectioninterface_unittest.cc
@@ -1173,6 +1173,32 @@
   EXPECT_TRUE(raw_port_allocator->initialized());
 }
 
+// Check that GetConfiguration returns the configuration the PeerConnection was
+// constructed with, before SetConfiguration is called.
+TEST_F(PeerConnectionInterfaceTest, GetConfigurationAfterCreatePeerConnection) {
+  PeerConnectionInterface::RTCConfiguration config;
+  config.type = PeerConnectionInterface::kRelay;
+  CreatePeerConnection(config, nullptr);
+
+  PeerConnectionInterface::RTCConfiguration returned_config =
+      pc_->GetConfiguration();
+  EXPECT_EQ(PeerConnectionInterface::kRelay, returned_config.type);
+}
+
+// Check that GetConfiguration returns the last configuration passed into
+// SetConfiguration.
+TEST_F(PeerConnectionInterfaceTest, GetConfigurationAfterSetConfiguration) {
+  CreatePeerConnection();
+
+  PeerConnectionInterface::RTCConfiguration config;
+  config.type = PeerConnectionInterface::kRelay;
+  EXPECT_TRUE(pc_->SetConfiguration(config));
+
+  PeerConnectionInterface::RTCConfiguration returned_config =
+      pc_->GetConfiguration();
+  EXPECT_EQ(PeerConnectionInterface::kRelay, returned_config.type);
+}
+
 TEST_F(PeerConnectionInterfaceTest, AddStreams) {
   CreatePeerConnection();
   AddVideoStream(kStreamLabel1);