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

Side by Side Diff: webrtc/api/peerconnectioninterface_unittest.cc

Issue 2504103002: Adding GetConfiguration to PeerConnection. (Closed)
Patch Set: Fixing typo in comment. Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/api/peerconnectionproxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 cricket::FakePortAllocator* raw_port_allocator = port_allocator.get(); 1159 cricket::FakePortAllocator* raw_port_allocator = port_allocator.get();
1160 PeerConnectionInterface::RTCConfiguration config; 1160 PeerConnectionInterface::RTCConfiguration config;
1161 rtc::scoped_refptr<PeerConnectionInterface> pc( 1161 rtc::scoped_refptr<PeerConnectionInterface> pc(
1162 pc_factory->CreatePeerConnection( 1162 pc_factory->CreatePeerConnection(
1163 config, nullptr, std::move(port_allocator), nullptr, &observer_)); 1163 config, nullptr, std::move(port_allocator), nullptr, &observer_));
1164 // FakePortAllocator RTC_CHECKs that it's initialized on the right thread, 1164 // FakePortAllocator RTC_CHECKs that it's initialized on the right thread,
1165 // so all we have to do here is check that it's initialized. 1165 // so all we have to do here is check that it's initialized.
1166 EXPECT_TRUE(raw_port_allocator->initialized()); 1166 EXPECT_TRUE(raw_port_allocator->initialized());
1167 } 1167 }
1168 1168
1169 // Check that GetConfiguration returns the configuration the PeerConnection was
1170 // constructed with, before SetConfiguration is called.
1171 TEST_F(PeerConnectionInterfaceTest, GetConfigurationAfterCreatePeerConnection) {
1172 PeerConnectionInterface::RTCConfiguration config;
1173 config.type = PeerConnectionInterface::kRelay;
1174 CreatePeerConnection(config, nullptr);
1175
1176 PeerConnectionInterface::RTCConfiguration returned_config =
1177 pc_->GetConfiguration();
1178 EXPECT_EQ(PeerConnectionInterface::kRelay, returned_config.type);
1179 }
1180
1181 // Check that GetConfiguration returns the last configuration passed into
1182 // SetConfiguration.
1183 TEST_F(PeerConnectionInterfaceTest, GetConfigurationAfterSetConfiguration) {
1184 CreatePeerConnection();
1185
1186 PeerConnectionInterface::RTCConfiguration config;
1187 config.type = PeerConnectionInterface::kRelay;
1188 EXPECT_TRUE(pc_->SetConfiguration(config));
1189
1190 PeerConnectionInterface::RTCConfiguration returned_config =
1191 pc_->GetConfiguration();
1192 EXPECT_EQ(PeerConnectionInterface::kRelay, returned_config.type);
1193 }
1194
1169 TEST_F(PeerConnectionInterfaceTest, AddStreams) { 1195 TEST_F(PeerConnectionInterfaceTest, AddStreams) {
1170 CreatePeerConnection(); 1196 CreatePeerConnection();
1171 AddVideoStream(kStreamLabel1); 1197 AddVideoStream(kStreamLabel1);
1172 AddVoiceStream(kStreamLabel2); 1198 AddVoiceStream(kStreamLabel2);
1173 ASSERT_EQ(2u, pc_->local_streams()->count()); 1199 ASSERT_EQ(2u, pc_->local_streams()->count());
1174 1200
1175 // Test we can add multiple local streams to one peerconnection. 1201 // Test we can add multiple local streams to one peerconnection.
1176 rtc::scoped_refptr<MediaStreamInterface> stream( 1202 rtc::scoped_refptr<MediaStreamInterface> stream(
1177 pc_factory_->CreateLocalMediaStream(kStreamLabel3)); 1203 pc_factory_->CreateLocalMediaStream(kStreamLabel3));
1178 rtc::scoped_refptr<AudioTrackInterface> audio_track( 1204 rtc::scoped_refptr<AudioTrackInterface> audio_track(
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
2892 FakeConstraints updated_answer_c; 2918 FakeConstraints updated_answer_c;
2893 answer_c.SetMandatoryReceiveAudio(false); 2919 answer_c.SetMandatoryReceiveAudio(false);
2894 answer_c.SetMandatoryReceiveVideo(false); 2920 answer_c.SetMandatoryReceiveVideo(false);
2895 2921
2896 cricket::MediaSessionOptions updated_answer_options; 2922 cricket::MediaSessionOptions updated_answer_options;
2897 EXPECT_TRUE( 2923 EXPECT_TRUE(
2898 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); 2924 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options));
2899 EXPECT_TRUE(updated_answer_options.has_audio()); 2925 EXPECT_TRUE(updated_answer_options.has_audio());
2900 EXPECT_TRUE(updated_answer_options.has_video()); 2926 EXPECT_TRUE(updated_answer_options.has_video());
2901 } 2927 }
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/api/peerconnectionproxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698