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 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 // Check that the expected number of frames have arrived. | 1458 // Check that the expected number of frames have arrived. |
1459 EXPECT_TRUE_WAIT(FramesHaveArrived(audio_frame_count, video_frame_count), | 1459 EXPECT_TRUE_WAIT(FramesHaveArrived(audio_frame_count, video_frame_count), |
1460 kMaxWaitForFramesMs); | 1460 kMaxWaitForFramesMs); |
1461 } | 1461 } |
1462 | 1462 |
1463 void SetupAndVerifyDtlsCall() { | 1463 void SetupAndVerifyDtlsCall() { |
1464 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 1464 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
1465 FakeConstraints setup_constraints; | 1465 FakeConstraints setup_constraints; |
1466 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, | 1466 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, |
1467 true); | 1467 true); |
1468 ASSERT_TRUE(CreateTestClients(&setup_constraints, &setup_constraints)); | 1468 // Disable resolution adaptation, we don't want it interfering with the |
| 1469 // test results. |
| 1470 webrtc::PeerConnectionInterface::RTCConfiguration rtc_config; |
| 1471 rtc_config.set_cpu_adaptation(false); |
| 1472 |
| 1473 ASSERT_TRUE(CreateTestClients(&setup_constraints, nullptr, &rtc_config, |
| 1474 &setup_constraints, nullptr, &rtc_config)); |
1469 LocalP2PTest(); | 1475 LocalP2PTest(); |
1470 VerifyRenderedSize(640, 480); | 1476 VerifyRenderedSize(640, 480); |
1471 } | 1477 } |
1472 | 1478 |
1473 PeerConnectionTestClient* CreateDtlsClientWithAlternateKey() { | 1479 PeerConnectionTestClient* CreateDtlsClientWithAlternateKey() { |
1474 FakeConstraints setup_constraints; | 1480 FakeConstraints setup_constraints; |
1475 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, | 1481 setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp, |
1476 true); | 1482 true); |
| 1483 // Disable resolution adaptation, we don't want it interfering with the |
| 1484 // test results. |
| 1485 webrtc::PeerConnectionInterface::RTCConfiguration rtc_config; |
| 1486 rtc_config.set_cpu_adaptation(false); |
1477 | 1487 |
1478 std::unique_ptr<FakeRTCCertificateGenerator> cert_generator( | 1488 std::unique_ptr<FakeRTCCertificateGenerator> cert_generator( |
1479 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? | 1489 rtc::SSLStreamAdapter::HaveDtlsSrtp() ? |
1480 new FakeRTCCertificateGenerator() : nullptr); | 1490 new FakeRTCCertificateGenerator() : nullptr); |
1481 cert_generator->use_alternate_key(); | 1491 cert_generator->use_alternate_key(); |
1482 | 1492 |
1483 // Make sure the new client is using a different certificate. | 1493 // Make sure the new client is using a different certificate. |
1484 return PeerConnectionTestClient::CreateClientWithDtlsIdentityStore( | 1494 return PeerConnectionTestClient::CreateClientWithDtlsIdentityStore( |
1485 "New Peer: ", &setup_constraints, nullptr, nullptr, | 1495 "New Peer: ", &setup_constraints, nullptr, &rtc_config, |
1486 std::move(cert_generator), prefer_constraint_apis_, | 1496 std::move(cert_generator), prefer_constraint_apis_, |
1487 network_thread_.get(), worker_thread_.get()); | 1497 network_thread_.get(), worker_thread_.get()); |
1488 } | 1498 } |
1489 | 1499 |
1490 void SendRtpData(webrtc::DataChannelInterface* dc, const std::string& data) { | 1500 void SendRtpData(webrtc::DataChannelInterface* dc, const std::string& data) { |
1491 // Messages may get lost on the unreliable DataChannel, so we send multiple | 1501 // Messages may get lost on the unreliable DataChannel, so we send multiple |
1492 // times to avoid test flakiness. | 1502 // times to avoid test flakiness. |
1493 static const size_t kSendAttempts = 5; | 1503 static const size_t kSendAttempts = 5; |
1494 | 1504 |
1495 for (size_t i = 0; i < kSendAttempts; ++i) { | 1505 for (size_t i = 0; i < kSendAttempts; ++i) { |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2774 server.urls.push_back("turn:hostname2"); | 2784 server.urls.push_back("turn:hostname2"); |
2775 servers.push_back(server); | 2785 servers.push_back(server); |
2776 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); | 2786 EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_)); |
2777 EXPECT_EQ(2U, turn_servers_.size()); | 2787 EXPECT_EQ(2U, turn_servers_.size()); |
2778 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); | 2788 EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority); |
2779 } | 2789 } |
2780 | 2790 |
2781 #endif // if !defined(THREAD_SANITIZER) | 2791 #endif // if !defined(THREAD_SANITIZER) |
2782 | 2792 |
2783 } // namespace | 2793 } // namespace |
OLD | NEW |