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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/pc/trackmediainfomap.cc » ('j') | 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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 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
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 // We received a frame, so we should have nonzero "bytes received" stats for 1922 // We received a frame, so we should have nonzero "bytes received" stats for
1923 // the unsignaled stream, if stats are working for it. 1923 // the unsignaled stream, if stats are working for it.
1924 rtc::scoped_refptr<const webrtc::RTCStatsReport> report = 1924 rtc::scoped_refptr<const webrtc::RTCStatsReport> report =
1925 callee()->NewGetStats(); 1925 callee()->NewGetStats();
1926 ASSERT_NE(nullptr, report); 1926 ASSERT_NE(nullptr, report);
1927 auto inbound_stream_stats = 1927 auto inbound_stream_stats =
1928 report->GetStatsOfType<webrtc::RTCInboundRTPStreamStats>(); 1928 report->GetStatsOfType<webrtc::RTCInboundRTPStreamStats>();
1929 ASSERT_EQ(1U, inbound_stream_stats.size()); 1929 ASSERT_EQ(1U, inbound_stream_stats.size());
1930 ASSERT_TRUE(inbound_stream_stats[0]->bytes_received.is_defined()); 1930 ASSERT_TRUE(inbound_stream_stats[0]->bytes_received.is_defined());
1931 ASSERT_GT(*inbound_stream_stats[0]->bytes_received, 0U); 1931 ASSERT_GT(*inbound_stream_stats[0]->bytes_received, 0U);
1932
1932 // TODO(deadbeef): Test that track_id is defined. This is not currently 1933 // TODO(deadbeef): Test that track_id is defined. This is not currently
1933 // working since SSRCs are used to match RtpReceivers (and their tracks) with 1934 // working since SSRCs are used to match RtpReceivers (and their tracks) with
1934 // received stream stats in TrackMediaInfoMap. 1935 // received stream stats in TrackMediaInfoMap.
Taylor Brandstetter 2017/05/17 01:30:04 Can this TODO be fixed in this CL?
1935 } 1936 }
1936 1937
1938 // Test that we can successfully get the media related stats (audio level
1939 // etc.) for the unsignaled stream.
1940 TEST_F(PeerConnectionIntegrationTest,
1941 GetMediaStatsForUnsignaledStreamWithNewStatsApi) {
1942 ASSERT_TRUE(CreatePeerConnectionWrappers());
1943 ConnectFakeSignaling();
1944 caller()->AddAudioVideoMediaStream();
1945 // Remove SSRCs and MSIDs from the received offer SDP.
1946 callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids);
1947 caller()->CreateAndSetAndSignalOffer();
1948 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
1949 // Wait for one audio frame to be received by the callee.
1950 ExpectNewFramesReceivedWithWait(0, 0, 1, 1, kMaxWaitForFramesMs);
1951
1952 rtc::scoped_refptr<const webrtc::RTCStatsReport> report =
1953 callee()->NewGetStats();
1954 ASSERT_NE(nullptr, report);
1955
1956 auto media_stats = report->GetStatsOfType<webrtc::RTCMediaStreamTrackStats>();
1957 ASSERT_GT(media_stats.size(), 0);
1958 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
1959 }
1960
1937 // Test that DTLS 1.0 is used if both sides only support DTLS 1.0. 1961 // Test that DTLS 1.0 is used if both sides only support DTLS 1.0.
1938 TEST_F(PeerConnectionIntegrationTest, EndToEndCallWithDtls10) { 1962 TEST_F(PeerConnectionIntegrationTest, EndToEndCallWithDtls10) {
1939 PeerConnectionFactory::Options dtls_10_options; 1963 PeerConnectionFactory::Options dtls_10_options;
1940 dtls_10_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10; 1964 dtls_10_options.ssl_max_version = rtc::SSL_PROTOCOL_DTLS_10;
1941 ASSERT_TRUE(CreatePeerConnectionWrappersWithOptions(dtls_10_options, 1965 ASSERT_TRUE(CreatePeerConnectionWrappersWithOptions(dtls_10_options,
1942 dtls_10_options)); 1966 dtls_10_options));
1943 ConnectFakeSignaling(); 1967 ConnectFakeSignaling();
1944 // Do normal offer/answer and wait for some frames to be received in each 1968 // Do normal offer/answer and wait for some frames to be received in each
1945 // direction. 1969 // direction.
1946 caller()->AddAudioVideoMediaStream(); 1970 caller()->AddAudioVideoMediaStream();
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
2905 caller()->CreateAndSetAndSignalOffer(); 2929 caller()->CreateAndSetAndSignalOffer();
2906 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); 2930 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
2907 // Wait for additional audio frames to be received by the callee. 2931 // Wait for additional audio frames to be received by the callee.
2908 ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0, 2932 ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0,
2909 kMaxWaitForFramesMs); 2933 kMaxWaitForFramesMs);
2910 } 2934 }
2911 2935
2912 } // namespace 2936 } // namespace
2913 2937
2914 #endif // if !defined(THREAD_SANITIZER) 2938 #endif // if !defined(THREAD_SANITIZER)
OLDNEW
« 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