OLD | NEW |
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 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 EXPECT_EQ(0U, session->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6); | 1271 EXPECT_EQ(0U, session->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6); |
1272 EXPECT_LT(0U, session->flags() & cricket::PORTALLOCATOR_DISABLE_TCP); | 1272 EXPECT_LT(0U, session->flags() & cricket::PORTALLOCATOR_DISABLE_TCP); |
1273 EXPECT_LT(0U, | 1273 EXPECT_LT(0U, |
1274 session->flags() & cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS); | 1274 session->flags() & cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS); |
1275 } | 1275 } |
1276 | 1276 |
1277 // Test that the PeerConnection initializes the port allocator passed into it, | 1277 // Test that the PeerConnection initializes the port allocator passed into it, |
1278 // and on the correct thread. | 1278 // and on the correct thread. |
1279 TEST_F(PeerConnectionInterfaceTest, | 1279 TEST_F(PeerConnectionInterfaceTest, |
1280 CreatePeerConnectionInitializesPortAllocator) { | 1280 CreatePeerConnectionInitializesPortAllocator) { |
1281 rtc::Thread network_thread; | 1281 std::unique_ptr<rtc::Thread> network_thread( |
1282 network_thread.Start(); | 1282 rtc::Thread::CreateWithSocketServer()); |
| 1283 network_thread->Start(); |
1283 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory( | 1284 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory( |
1284 webrtc::CreatePeerConnectionFactory( | 1285 webrtc::CreatePeerConnectionFactory( |
1285 &network_thread, rtc::Thread::Current(), rtc::Thread::Current(), | 1286 network_thread.get(), rtc::Thread::Current(), rtc::Thread::Current(), |
1286 nullptr, nullptr, nullptr)); | 1287 nullptr, nullptr, nullptr)); |
1287 std::unique_ptr<cricket::FakePortAllocator> port_allocator( | 1288 std::unique_ptr<cricket::FakePortAllocator> port_allocator( |
1288 new cricket::FakePortAllocator(&network_thread, nullptr)); | 1289 new cricket::FakePortAllocator(network_thread.get(), nullptr)); |
1289 cricket::FakePortAllocator* raw_port_allocator = port_allocator.get(); | 1290 cricket::FakePortAllocator* raw_port_allocator = port_allocator.get(); |
1290 PeerConnectionInterface::RTCConfiguration config; | 1291 PeerConnectionInterface::RTCConfiguration config; |
1291 rtc::scoped_refptr<PeerConnectionInterface> pc( | 1292 rtc::scoped_refptr<PeerConnectionInterface> pc( |
1292 pc_factory->CreatePeerConnection( | 1293 pc_factory->CreatePeerConnection( |
1293 config, nullptr, std::move(port_allocator), nullptr, &observer_)); | 1294 config, nullptr, std::move(port_allocator), nullptr, &observer_)); |
1294 // FakePortAllocator RTC_CHECKs that it's initialized on the right thread, | 1295 // FakePortAllocator RTC_CHECKs that it's initialized on the right thread, |
1295 // so all we have to do here is check that it's initialized. | 1296 // so all we have to do here is check that it's initialized. |
1296 EXPECT_TRUE(raw_port_allocator->initialized()); | 1297 EXPECT_TRUE(raw_port_allocator->initialized()); |
1297 } | 1298 } |
1298 | 1299 |
(...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3695 EXPECT_NE(a, f); | 3696 EXPECT_NE(a, f); |
3696 | 3697 |
3697 PeerConnectionInterface::RTCConfiguration g; | 3698 PeerConnectionInterface::RTCConfiguration g; |
3698 g.disable_ipv6 = true; | 3699 g.disable_ipv6 = true; |
3699 EXPECT_NE(a, g); | 3700 EXPECT_NE(a, g); |
3700 | 3701 |
3701 PeerConnectionInterface::RTCConfiguration h( | 3702 PeerConnectionInterface::RTCConfiguration h( |
3702 PeerConnectionInterface::RTCConfigurationType::kAggressive); | 3703 PeerConnectionInterface::RTCConfigurationType::kAggressive); |
3703 EXPECT_NE(a, h); | 3704 EXPECT_NE(a, h); |
3704 } | 3705 } |
OLD | NEW |