Index: content/renderer/media/rtc_peer_connection_handler_unittest.cc |
diff --git a/content/renderer/media/rtc_peer_connection_handler_unittest.cc b/content/renderer/media/rtc_peer_connection_handler_unittest.cc |
index 63b418702f2766be47af2cc81bff8c07fcdf2137..f2bec284ae3a2ad4ef58098c044105c4bd8d7418 100644 |
--- a/content/renderer/media/rtc_peer_connection_handler_unittest.cc |
+++ b/content/renderer/media/rtc_peer_connection_handler_unittest.cc |
@@ -43,6 +43,7 @@ |
#include "third_party/WebKit/public/platform/WebRTCDTMFSenderHandler.h" |
#include "third_party/WebKit/public/platform/WebRTCDataChannelHandler.h" |
#include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h" |
+#include "third_party/WebKit/public/platform/WebRTCError.h" |
#include "third_party/WebKit/public/platform/WebRTCICECandidate.h" |
#include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandlerClient.h" |
#include "third_party/WebKit/public/platform/WebRTCSessionDescription.h" |
@@ -580,7 +581,22 @@ TEST_F(RTCPeerConnectionHandlerTest, setConfiguration) { |
// TODO(perkj): Test that the parameters in |config| can be translated when a |
// WebRTCConfiguration can be constructed. It's WebKit class and can't be |
// initialized from a test. |
- EXPECT_TRUE(pc_handler_->setConfiguration(config)); |
+ blink::WebRTCError error; |
+ EXPECT_TRUE(pc_handler_->setConfiguration(config, error)); |
+} |
+ |
+// Test that when an error occurs in SetConfiguration, it's converted to a |
+// blink error and false is returned. |
+TEST_F(RTCPeerConnectionHandlerTest, setConfigurationError) { |
+ blink::WebRTCConfiguration config; |
+ |
+ mock_peer_connection_->set_setconfiguration_error_type( |
+ webrtc::RTCErrorType::INVALID_MODIFICATION); |
+ EXPECT_CALL(*mock_tracker_.get(), |
+ TrackSetConfiguration(pc_handler_.get(), _)); |
+ blink::WebRTCError error; |
+ EXPECT_FALSE(pc_handler_->setConfiguration(config, error)); |
+ EXPECT_EQ(blink::WebRTCErrorType::kInvalidModification, error.type()); |
} |
TEST_F(RTCPeerConnectionHandlerTest, addICECandidate) { |