OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 |
11 #include "webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.h" | 11 #include "webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.h" |
12 | 12 |
13 class EcMetricsTest : public AfterStreamingFixture { | 13 class EcMetricsTest : public AfterStreamingFixture { |
14 }; | 14 }; |
15 | 15 |
16 TEST_F(EcMetricsTest, EcMetricsAreOnByDefault) { | 16 TEST_F(EcMetricsTest, EcMetricsAreOffByDefault) { |
17 // AEC must be enabled fist. | 17 bool enabled = true; |
18 EXPECT_EQ(0, voe_apm_->SetEcStatus(true, webrtc::kEcAec)); | |
19 | |
20 bool enabled = false; | |
21 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(enabled)); | 18 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(enabled)); |
22 EXPECT_TRUE(enabled); | 19 EXPECT_FALSE(enabled); |
23 } | 20 } |
24 | 21 |
25 TEST_F(EcMetricsTest, CanEnableAndDisableEcMetrics) { | 22 TEST_F(EcMetricsTest, CanEnableAndDisableEcMetrics) { |
26 // AEC must be enabled fist. | |
27 EXPECT_EQ(0, voe_apm_->SetEcStatus(true, webrtc::kEcAec)); | |
28 | |
29 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(true)); | 23 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(true)); |
30 bool ec_on = false; | 24 bool ec_on = false; |
31 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(ec_on)); | 25 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(ec_on)); |
32 ASSERT_TRUE(ec_on); | 26 ASSERT_TRUE(ec_on); |
33 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(false)); | 27 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(false)); |
34 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(ec_on)); | 28 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(ec_on)); |
35 ASSERT_FALSE(ec_on); | 29 ASSERT_FALSE(ec_on); |
36 } | 30 } |
37 | 31 |
38 TEST_F(EcMetricsTest, ManualTestEcMetrics) { | 32 TEST_F(EcMetricsTest, ManualTestEcMetrics) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 for (int i = 0; i < 5; i++) { | 81 for (int i = 0; i < 5; i++) { |
88 int delay, delay_std; | 82 int delay, delay_std; |
89 float fraction_poor_delays; | 83 float fraction_poor_delays; |
90 EXPECT_EQ(0, voe_apm_->GetEcDelayMetrics(delay, delay_std, | 84 EXPECT_EQ(0, voe_apm_->GetEcDelayMetrics(delay, delay_std, |
91 fraction_poor_delays)); | 85 fraction_poor_delays)); |
92 TEST_LOG("Delay = %d, Delay Std = %d, Fraction poor delays = %3.1f\n", | 86 TEST_LOG("Delay = %d, Delay Std = %d, Fraction poor delays = %3.1f\n", |
93 delay, delay_std, fraction_poor_delays * 100); | 87 delay, delay_std, fraction_poor_delays * 100); |
94 Sleep(1000); | 88 Sleep(1000); |
95 } | 89 } |
96 } | 90 } |
OLD | NEW |