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

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

Issue 1987833002: Add a flag to filter out high-cost networks. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: merge with head Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/p2p/base/portallocator.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 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 // in the RTCConfiguration. 1043 // in the RTCConfiguration.
1044 TEST_F(PeerConnectionInterfaceTest, CreatePeerConnectionWithPooledCandidates) { 1044 TEST_F(PeerConnectionInterfaceTest, CreatePeerConnectionWithPooledCandidates) {
1045 PeerConnectionInterface::RTCConfiguration config; 1045 PeerConnectionInterface::RTCConfiguration config;
1046 PeerConnectionInterface::IceServer server; 1046 PeerConnectionInterface::IceServer server;
1047 server.uri = kStunAddressOnly; 1047 server.uri = kStunAddressOnly;
1048 config.servers.push_back(server); 1048 config.servers.push_back(server);
1049 config.type = PeerConnectionInterface::kRelay; 1049 config.type = PeerConnectionInterface::kRelay;
1050 config.disable_ipv6 = true; 1050 config.disable_ipv6 = true;
1051 config.tcp_candidate_policy = 1051 config.tcp_candidate_policy =
1052 PeerConnectionInterface::kTcpCandidatePolicyDisabled; 1052 PeerConnectionInterface::kTcpCandidatePolicyDisabled;
1053 config.candidate_network_policy =
1054 PeerConnectionInterface::kCandidateNetworkPolicyLowCost;
1053 config.ice_candidate_pool_size = 1; 1055 config.ice_candidate_pool_size = 1;
1054 CreatePeerConnection(config, nullptr); 1056 CreatePeerConnection(config, nullptr);
1055 1057
1056 const cricket::FakePortAllocatorSession* session = 1058 const cricket::FakePortAllocatorSession* session =
1057 static_cast<const cricket::FakePortAllocatorSession*>( 1059 static_cast<const cricket::FakePortAllocatorSession*>(
1058 port_allocator_->GetPooledSession()); 1060 port_allocator_->GetPooledSession());
1059 ASSERT_NE(nullptr, session); 1061 ASSERT_NE(nullptr, session);
1060 EXPECT_EQ(1UL, session->stun_servers().size()); 1062 EXPECT_EQ(1UL, session->stun_servers().size());
1061 EXPECT_EQ(0U, session->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6); 1063 EXPECT_EQ(0U, session->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6);
1062 EXPECT_LT(0U, session->flags() & cricket::PORTALLOCATOR_DISABLE_TCP); 1064 EXPECT_LT(0U, session->flags() & cricket::PORTALLOCATOR_DISABLE_TCP);
1065 EXPECT_LT(0U,
1066 session->flags() & cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS);
1063 } 1067 }
1064 1068
1065 TEST_F(PeerConnectionInterfaceTest, AddStreams) { 1069 TEST_F(PeerConnectionInterfaceTest, AddStreams) {
1066 CreatePeerConnection(); 1070 CreatePeerConnection();
1067 AddVideoStream(kStreamLabel1); 1071 AddVideoStream(kStreamLabel1);
1068 AddVoiceStream(kStreamLabel2); 1072 AddVoiceStream(kStreamLabel2);
1069 ASSERT_EQ(2u, pc_->local_streams()->count()); 1073 ASSERT_EQ(2u, pc_->local_streams()->count());
1070 1074
1071 // Test we can add multiple local streams to one peerconnection. 1075 // Test we can add multiple local streams to one peerconnection.
1072 scoped_refptr<MediaStreamInterface> stream( 1076 scoped_refptr<MediaStreamInterface> stream(
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2806 FakeConstraints updated_answer_c; 2810 FakeConstraints updated_answer_c;
2807 answer_c.SetMandatoryReceiveAudio(false); 2811 answer_c.SetMandatoryReceiveAudio(false);
2808 answer_c.SetMandatoryReceiveVideo(false); 2812 answer_c.SetMandatoryReceiveVideo(false);
2809 2813
2810 cricket::MediaSessionOptions updated_answer_options; 2814 cricket::MediaSessionOptions updated_answer_options;
2811 EXPECT_TRUE( 2815 EXPECT_TRUE(
2812 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); 2816 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options));
2813 EXPECT_TRUE(updated_answer_options.has_audio()); 2817 EXPECT_TRUE(updated_answer_options.has_audio());
2814 EXPECT_TRUE(updated_answer_options.has_video()); 2818 EXPECT_TRUE(updated_answer_options.has_video());
2815 } 2819 }
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/p2p/base/portallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698