| OLD | NEW |
| 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 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1907 expected_caller_received_frames, expected_caller_received_frames, | 1907 expected_caller_received_frames, expected_caller_received_frames, |
| 1908 kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount, | 1908 kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount, |
| 1909 kMaxWaitForFramesMs); | 1909 kMaxWaitForFramesMs); |
| 1910 | 1910 |
| 1911 // The callee received frames, so we definitely should have nonzero "sent | 1911 // The callee received frames, so we definitely should have nonzero "sent |
| 1912 // bytes" stats at this point. | 1912 // bytes" stats at this point. |
| 1913 EXPECT_GT(caller()->OldGetStatsForTrack(audio_track)->BytesSent(), 0); | 1913 EXPECT_GT(caller()->OldGetStatsForTrack(audio_track)->BytesSent(), 0); |
| 1914 EXPECT_GT(caller()->OldGetStatsForTrack(video_track)->BytesSent(), 0); | 1914 EXPECT_GT(caller()->OldGetStatsForTrack(video_track)->BytesSent(), 0); |
| 1915 } | 1915 } |
| 1916 | 1916 |
| 1917 // Test that we can get capture start ntp time. |
| 1918 TEST_F(PeerConnectionIntegrationTest, GetCaptureStartNtpTimeWithOldStatsApi) { |
| 1919 ASSERT_TRUE(CreatePeerConnectionWrappers()); |
| 1920 ConnectFakeSignaling(); |
| 1921 caller()->AddAudioOnlyMediaStream(); |
| 1922 |
| 1923 auto audio_track = callee()->CreateLocalAudioTrack(); |
| 1924 callee()->AddMediaStreamFromTracks(audio_track, nullptr); |
| 1925 |
| 1926 // Do offer/answer, wait for the callee to receive some frames. |
| 1927 caller()->CreateAndSetAndSignalOffer(); |
| 1928 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); |
| 1929 |
| 1930 // Get the remote audio track created on the receiver, so they can be used as |
| 1931 // GetStats filters. |
| 1932 StreamCollectionInterface* remote_streams = callee()->remote_streams(); |
| 1933 ASSERT_EQ(1u, remote_streams->count()); |
| 1934 ASSERT_EQ(1u, remote_streams->at(0)->GetAudioTracks().size()); |
| 1935 MediaStreamTrackInterface* remote_audio_track = |
| 1936 remote_streams->at(0)->GetAudioTracks()[0]; |
| 1937 |
| 1938 // Get the audio output level stats. Note that the level is not available |
| 1939 // until an RTCP packet has been received. |
| 1940 EXPECT_TRUE_WAIT(callee()->OldGetStatsForTrack(remote_audio_track)-> |
| 1941 CaptureStartNtpTime() > 0, 2 * kMaxWaitForFramesMs); |
| 1942 } |
| 1943 |
| 1917 // Test that we can get stats (using the new stats implemnetation) for | 1944 // Test that we can get stats (using the new stats implemnetation) for |
| 1918 // unsignaled streams. Meaning when SSRCs/MSIDs aren't signaled explicitly in | 1945 // unsignaled streams. Meaning when SSRCs/MSIDs aren't signaled explicitly in |
| 1919 // SDP. | 1946 // SDP. |
| 1920 TEST_F(PeerConnectionIntegrationTest, | 1947 TEST_F(PeerConnectionIntegrationTest, |
| 1921 GetStatsForUnsignaledStreamWithNewStatsApi) { | 1948 GetStatsForUnsignaledStreamWithNewStatsApi) { |
| 1922 ASSERT_TRUE(CreatePeerConnectionWrappers()); | 1949 ASSERT_TRUE(CreatePeerConnectionWrappers()); |
| 1923 ConnectFakeSignaling(); | 1950 ConnectFakeSignaling(); |
| 1924 caller()->AddAudioOnlyMediaStream(); | 1951 caller()->AddAudioOnlyMediaStream(); |
| 1925 // Remove SSRCs and MSIDs from the received offer SDP. | 1952 // Remove SSRCs and MSIDs from the received offer SDP. |
| 1926 callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); | 1953 callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2971 caller()->CreateAndSetAndSignalOffer(); | 2998 caller()->CreateAndSetAndSignalOffer(); |
| 2972 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); | 2999 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); |
| 2973 // Wait for additional audio frames to be received by the callee. | 3000 // Wait for additional audio frames to be received by the callee. |
| 2974 ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0, | 3001 ExpectNewFramesReceivedWithWait(0, 0, kDefaultExpectedAudioFrameCount, 0, |
| 2975 kMaxWaitForFramesMs); | 3002 kMaxWaitForFramesMs); |
| 2976 } | 3003 } |
| 2977 | 3004 |
| 2978 } // namespace | 3005 } // namespace |
| 2979 | 3006 |
| 2980 #endif // if !defined(THREAD_SANITIZER) | 3007 #endif // if !defined(THREAD_SANITIZER) |
| OLD | NEW |