Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Unified Diff: content/renderer/media/rtc_peer_connection_handler_unittest.cc

Issue 2631433002: Rename RTCPeerConnection.updateIce to setConfiguration and make it work. (Closed)
Patch Set: Rebase. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 8f1dbcd9c60e69f4d2e426331b8042f9fa66b086..7d44b983f31994bf2d01cb33570650e5faa889ae 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"
@@ -584,7 +585,21 @@ 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));
+ EXPECT_EQ(blink::WebRTCErrorType::kNone,
+ pc_handler_->setConfiguration(config));
+}
+
+// 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(), _));
+ EXPECT_EQ(blink::WebRTCErrorType::kInvalidModification,
+ pc_handler_->setConfiguration(config));
}
TEST_F(RTCPeerConnectionHandlerTest, addICECandidate) {
« no previous file with comments | « content/renderer/media/rtc_peer_connection_handler.cc ('k') | content/test/data/media/peerconnection-setConfiguration.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698