2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #include "webrtc/test/testsupport/fileutils.h"
12 #include "webrtc/voice_engine/test/auto_test/fixtures/after_streaming_fixture.h"
14 class CallReportTest : public AfterStreamingFixture {
17 TEST_F(CallReportTest, ResetCallReportStatisticsFailsForBadInput) {
18 EXPECT_EQ(-1, voe_call_report_->ResetCallReportStatistics(-2));
19 EXPECT_EQ(-1, voe_call_report_->ResetCallReportStatistics(1));
22 TEST_F(CallReportTest, ResetCallReportStatisticsSucceedsWithCorrectInput) {
23 EXPECT_EQ(0, voe_call_report_->ResetCallReportStatistics(channel_));
24 EXPECT_EQ(0, voe_call_report_->ResetCallReportStatistics(-1));
27 TEST_F(CallReportTest, EchoMetricSummarySucceeds) {
28 EXPECT_EQ(0, voe_apm_->SetEcMetricsStatus(true));
31 webrtc::EchoStatistics echo_statistics;
32 EXPECT_EQ(0, voe_call_report_->GetEchoMetricSummary(echo_statistics));
35 TEST_F(CallReportTest, GetRoundTripTimeSummaryReturnsAllMinusOnesIfRtcpIsOff) {
36 voe_rtp_rtcp_->SetRTCPStatus(channel_, false);
38 webrtc::StatVal delays;
39 EXPECT_EQ(0, voe_call_report_->GetRoundTripTimeSummary(channel_, delays));
40 EXPECT_EQ(-1, delays.average);
41 EXPECT_EQ(-1, delays.min);
42 EXPECT_EQ(-1, delays.max);
45 // Flaky: https://code.google.com/p/webrtc/issues/detail?id=1719
46 TEST_F(CallReportTest, DISABLED_GetRoundTripTimesReturnsValuesIfRtcpIsOn) {
47 voe_rtp_rtcp_->SetRTCPStatus(channel_, true);
50 webrtc::StatVal delays;
51 EXPECT_EQ(0, voe_call_report_->GetRoundTripTimeSummary(channel_, delays));
52 EXPECT_NE(-1, delays.average);
53 EXPECT_NE(-1, delays.min);
54 EXPECT_NE(-1, delays.max);
57 TEST_F(CallReportTest, WriteReportToFileFailsOnBadInput) {
58 EXPECT_EQ(-1, voe_call_report_->WriteReportToFile(NULL));
61 TEST_F(CallReportTest, WriteReportToFileSucceedsWithCorrectFilename) {
62 std::string output_path = webrtc::test::OutputPath();
63 std::string report_filename = output_path + "call_report.txt";
65 EXPECT_EQ(0, voe_call_report_->WriteReportToFile(report_filename.c_str()));