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

Side by Side Diff: webrtc/api/rtcstatscollector_unittest.cc

Issue 2573443002: Skip RTCMediaStreamTrackStats.echoReturnLoss[Enhancement] default value. (Closed)
Patch Set: Unittest for the -100 = undefined case Created 4 years 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/api/rtcstatscollector.cc ('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 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 expected_remote_audio_track.audio_level = 0.0; 1202 expected_remote_audio_track.audio_level = 0.0;
1203 expected_remote_audio_track.echo_return_loss = 13.0; 1203 expected_remote_audio_track.echo_return_loss = 13.0;
1204 expected_remote_audio_track.echo_return_loss_enhancement = 37.0; 1204 expected_remote_audio_track.echo_return_loss_enhancement = 37.0;
1205 EXPECT_TRUE(report->Get(expected_remote_audio_track.id())); 1205 EXPECT_TRUE(report->Get(expected_remote_audio_track.id()));
1206 EXPECT_EQ(expected_remote_audio_track, 1206 EXPECT_EQ(expected_remote_audio_track,
1207 report->Get(expected_remote_audio_track.id())->cast_to< 1207 report->Get(expected_remote_audio_track.id())->cast_to<
1208 RTCMediaStreamTrackStats>()); 1208 RTCMediaStreamTrackStats>());
1209 } 1209 }
1210 1210
1211 TEST_F(RTCStatsCollectorTest, 1211 TEST_F(RTCStatsCollectorTest,
1212 CollectRTCMediaStreamStatsAndRTCMediaStreamTrackStats_Audio_Defaults) {
1213 rtc::scoped_refptr<StreamCollection> local_streams =
1214 StreamCollection::Create();
1215 EXPECT_CALL(test_->pc(), local_streams())
1216 .WillRepeatedly(Return(local_streams));
1217
1218 rtc::scoped_refptr<MediaStream> local_stream =
1219 MediaStream::Create("LocalStreamLabel");
1220 local_streams->AddStream(local_stream);
1221
1222 // Local audio track
1223 AudioProcessorInterface::AudioProcessorStats local_audio_processor_stats;
1224 local_audio_processor_stats.echo_return_loss = -100;
1225 local_audio_processor_stats.echo_return_loss_enhancement = -100;
1226 rtc::scoped_refptr<FakeAudioTrackForStats> local_audio_track =
1227 FakeAudioTrackForStats::Create(
1228 "LocalAudioTrackID",
1229 MediaStreamTrackInterface::TrackState::kEnded,
1230 32767,
1231 new FakeAudioProcessorForStats(local_audio_processor_stats));
1232 local_stream->AddTrack(local_audio_track);
1233
1234 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport();
1235
1236 RTCMediaStreamTrackStats expected_local_audio_track(
1237 "RTCMediaStreamTrack_LocalAudioTrackID", report->timestamp_us());
1238 expected_local_audio_track.track_identifier = local_audio_track->id();
1239 expected_local_audio_track.remote_source = false;
1240 expected_local_audio_track.ended = true;
1241 expected_local_audio_track.detached = false;
1242 expected_local_audio_track.audio_level = 1.0;
1243 // Should be undefined: |expected_local_audio_track.echo_return_loss| and
1244 // |expected_local_audio_track.echo_return_loss_enhancement|.
1245 EXPECT_TRUE(report->Get(expected_local_audio_track.id()));
1246 EXPECT_EQ(expected_local_audio_track,
1247 report->Get(expected_local_audio_track.id())->cast_to<
1248 RTCMediaStreamTrackStats>());
1249 }
1250
1251 TEST_F(RTCStatsCollectorTest,
1212 CollectRTCMediaStreamStatsAndRTCMediaStreamTrackStats_Video) { 1252 CollectRTCMediaStreamStatsAndRTCMediaStreamTrackStats_Video) {
1213 rtc::scoped_refptr<StreamCollection> local_streams = 1253 rtc::scoped_refptr<StreamCollection> local_streams =
1214 StreamCollection::Create(); 1254 StreamCollection::Create();
1215 rtc::scoped_refptr<StreamCollection> remote_streams = 1255 rtc::scoped_refptr<StreamCollection> remote_streams =
1216 StreamCollection::Create(); 1256 StreamCollection::Create();
1217 EXPECT_CALL(test_->pc(), local_streams()) 1257 EXPECT_CALL(test_->pc(), local_streams())
1218 .WillRepeatedly(Return(local_streams)); 1258 .WillRepeatedly(Return(local_streams));
1219 EXPECT_CALL(test_->pc(), remote_streams()) 1259 EXPECT_CALL(test_->pc(), remote_streams())
1220 .WillRepeatedly(Return(remote_streams)); 1260 .WillRepeatedly(Return(remote_streams));
1221 1261
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; 1794 rtc::scoped_refptr<FakeRTCStatsCollector> collector_;
1755 }; 1795 };
1756 1796
1757 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { 1797 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) {
1758 collector_->VerifyThreadUsageAndResultsMerging(); 1798 collector_->VerifyThreadUsageAndResultsMerging();
1759 } 1799 }
1760 1800
1761 } // namespace 1801 } // namespace
1762 1802
1763 } // namespace webrtc 1803 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/rtcstatscollector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698