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

Side by Side Diff: webrtc/voice_engine/test/auto_test/extended/ec_metrics_test.cc

Issue 2458993002: Reland of New statistics interface for APM (Closed)
Patch Set: Added implementation of the new non-pure interface function. 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/modules/audio_processing/include/mock_audio_processing.h ('k') | no next file » | 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 (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, EcMetricsAreOffByDefault) { 16 TEST_F(EcMetricsTest, EcMetricsAreOnByDefault) {
17 bool enabled = true; 17 // AEC must be enabled fist.
18 EXPECT_EQ(0, voe_apm_->SetEcStatus(true, webrtc::kEcAec));
19
20 bool enabled = false;
18 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(enabled)); 21 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(enabled));
19 EXPECT_FALSE(enabled); 22 EXPECT_TRUE(enabled);
20 } 23 }
21 24
22 TEST_F(EcMetricsTest, CanEnableAndDisableEcMetrics) { 25 TEST_F(EcMetricsTest, CanEnableAndDisableEcMetrics) {
26 // AEC must be enabled fist.
27 EXPECT_EQ(0, voe_apm_->SetEcStatus(true, webrtc::kEcAec));
28
23 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(true)); 29 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(true));
24 bool ec_on = false; 30 bool ec_on = false;
25 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(ec_on)); 31 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(ec_on));
26 ASSERT_TRUE(ec_on); 32 ASSERT_TRUE(ec_on);
27 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(false)); 33 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(false));
28 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(ec_on)); 34 EXPECT_EQ(0, voe_apm_->GetEcMetricsStatus(ec_on));
29 ASSERT_FALSE(ec_on); 35 ASSERT_FALSE(ec_on);
30 } 36 }
31 37
32 TEST_F(EcMetricsTest, ManualTestEcMetrics) { 38 TEST_F(EcMetricsTest, ManualTestEcMetrics) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 for (int i = 0; i < 5; i++) { 87 for (int i = 0; i < 5; i++) {
82 int delay, delay_std; 88 int delay, delay_std;
83 float fraction_poor_delays; 89 float fraction_poor_delays;
84 EXPECT_EQ(0, voe_apm_->GetEcDelayMetrics(delay, delay_std, 90 EXPECT_EQ(0, voe_apm_->GetEcDelayMetrics(delay, delay_std,
85 fraction_poor_delays)); 91 fraction_poor_delays));
86 TEST_LOG("Delay = %d, Delay Std = %d, Fraction poor delays = %3.1f\n", 92 TEST_LOG("Delay = %d, Delay Std = %d, Fraction poor delays = %3.1f\n",
87 delay, delay_std, fraction_poor_delays * 100); 93 delay, delay_std, fraction_poor_delays * 100);
88 Sleep(1000); 94 Sleep(1000);
89 } 95 }
90 } 96 }
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/include/mock_audio_processing.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698