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

Unified Diff: webrtc/pc/peerconnection_integrationtest.cc

Issue 2883943003: Add media related stats (audio level etc.) to unsignaled streams. (Closed)
Patch Set: Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/pc/trackmediainfomap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnection_integrationtest.cc
diff --git a/webrtc/pc/peerconnection_integrationtest.cc b/webrtc/pc/peerconnection_integrationtest.cc
index 2c19c8d93ebfd1360207b873fd73aeb65f0f6635..6386553e9cb8aada6e174edcc57533c3404afad8 100644
--- a/webrtc/pc/peerconnection_integrationtest.cc
+++ b/webrtc/pc/peerconnection_integrationtest.cc
@@ -1929,11 +1929,35 @@ TEST_F(PeerConnectionIntegrationTest,
ASSERT_EQ(1U, inbound_stream_stats.size());
ASSERT_TRUE(inbound_stream_stats[0]->bytes_received.is_defined());
ASSERT_GT(*inbound_stream_stats[0]->bytes_received, 0U);
+
// TODO(deadbeef): Test that track_id is defined. This is not currently
// working since SSRCs are used to match RtpReceivers (and their tracks) with
// received stream stats in TrackMediaInfoMap.
Taylor Brandstetter 2017/05/17 01:30:04 Can this TODO be fixed in this CL?
}
+// Test that we can successfully get the media related stats (audio level
+// etc.) for the unsignaled stream.
+TEST_F(PeerConnectionIntegrationTest,
+ GetMediaStatsForUnsignaledStreamWithNewStatsApi) {
+ ASSERT_TRUE(CreatePeerConnectionWrappers());
+ ConnectFakeSignaling();
+ caller()->AddAudioVideoMediaStream();
+ // Remove SSRCs and MSIDs from the received offer SDP.
+ callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids);
+ caller()->CreateAndSetAndSignalOffer();
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
+ // Wait for one audio frame to be received by the callee.
+ ExpectNewFramesReceivedWithWait(0, 0, 1, 1, kMaxWaitForFramesMs);
+
+ rtc::scoped_refptr<const webrtc::RTCStatsReport> report =
+ callee()->NewGetStats();
+ ASSERT_NE(nullptr, report);
+
+ auto media_stats = report->GetStatsOfType<webrtc::RTCMediaStreamTrackStats>();
+ ASSERT_GT(media_stats.size(), 0);
+ EXPECT_TRUE(media_stats[0]->audio_level.is_defined());
Taylor Brandstetter 2017/05/17 01:30:04 This relies on media_stats[0] being the audio trac
+}
+
// Test that DTLS 1.0 is used if both sides only support DTLS 1.0.
TEST_F(PeerConnectionIntegrationTest, EndToEndCallWithDtls10) {
PeerConnectionFactory::Options dtls_10_options;
« no previous file with comments | « no previous file | webrtc/pc/trackmediainfomap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698