OLD | NEW |
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 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 [&session_stats](const ChannelNamePairs&) { | 1715 [&session_stats](const ChannelNamePairs&) { |
1716 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); | 1716 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); |
1717 })); | 1717 })); |
1718 EXPECT_CALL(test_->session(), voice_channel()) | 1718 EXPECT_CALL(test_->session(), voice_channel()) |
1719 .WillRepeatedly(Return(&voice_channel)); | 1719 .WillRepeatedly(Return(&voice_channel)); |
1720 | 1720 |
1721 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | 1721 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); |
1722 | 1722 |
1723 RTCInboundRTPStreamStats expected_audio( | 1723 RTCInboundRTPStreamStats expected_audio( |
1724 "RTCInboundRTPAudioStream_1", report->timestamp_us()); | 1724 "RTCInboundRTPAudioStream_1", report->timestamp_us()); |
1725 expected_audio.ssrc = "1"; | 1725 expected_audio.ssrc = 1; |
1726 expected_audio.is_remote = false; | 1726 expected_audio.is_remote = false; |
1727 expected_audio.media_type = "audio"; | 1727 expected_audio.media_type = "audio"; |
1728 expected_audio.track_id = | 1728 expected_audio.track_id = |
1729 "RTCMediaStreamTrack_remote_audio_RemoteAudioTrackID_1"; | 1729 "RTCMediaStreamTrack_remote_audio_RemoteAudioTrackID_1"; |
1730 expected_audio.transport_id = "RTCTransport_TransportName_" + | 1730 expected_audio.transport_id = "RTCTransport_TransportName_" + |
1731 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); | 1731 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); |
1732 expected_audio.codec_id = "RTCCodec_InboundAudio_42"; | 1732 expected_audio.codec_id = "RTCCodec_InboundAudio_42"; |
1733 expected_audio.packets_received = 2; | 1733 expected_audio.packets_received = 2; |
1734 expected_audio.bytes_received = 3; | 1734 expected_audio.bytes_received = 3; |
1735 expected_audio.packets_lost = 42; | 1735 expected_audio.packets_lost = 42; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 [&session_stats](const ChannelNamePairs&) { | 1798 [&session_stats](const ChannelNamePairs&) { |
1799 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); | 1799 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); |
1800 })); | 1800 })); |
1801 EXPECT_CALL(test_->session(), video_channel()) | 1801 EXPECT_CALL(test_->session(), video_channel()) |
1802 .WillRepeatedly(Return(&video_channel)); | 1802 .WillRepeatedly(Return(&video_channel)); |
1803 | 1803 |
1804 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | 1804 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); |
1805 | 1805 |
1806 RTCInboundRTPStreamStats expected_video( | 1806 RTCInboundRTPStreamStats expected_video( |
1807 "RTCInboundRTPVideoStream_1", report->timestamp_us()); | 1807 "RTCInboundRTPVideoStream_1", report->timestamp_us()); |
1808 expected_video.ssrc = "1"; | 1808 expected_video.ssrc = 1; |
1809 expected_video.is_remote = false; | 1809 expected_video.is_remote = false; |
1810 expected_video.media_type = "video"; | 1810 expected_video.media_type = "video"; |
1811 expected_video.track_id = | 1811 expected_video.track_id = |
1812 "RTCMediaStreamTrack_remote_video_RemoteVideoTrackID_1"; | 1812 "RTCMediaStreamTrack_remote_video_RemoteVideoTrackID_1"; |
1813 expected_video.transport_id = "RTCTransport_TransportName_" + | 1813 expected_video.transport_id = "RTCTransport_TransportName_" + |
1814 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); | 1814 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); |
1815 expected_video.codec_id = "RTCCodec_InboundVideo_42"; | 1815 expected_video.codec_id = "RTCCodec_InboundVideo_42"; |
1816 expected_video.fir_count = 5; | 1816 expected_video.fir_count = 5; |
1817 expected_video.pli_count = 6; | 1817 expected_video.pli_count = 6; |
1818 expected_video.nack_count = 7; | 1818 expected_video.nack_count = 7; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 [&session_stats](const ChannelNamePairs&) { | 1878 [&session_stats](const ChannelNamePairs&) { |
1879 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); | 1879 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); |
1880 })); | 1880 })); |
1881 EXPECT_CALL(test_->session(), voice_channel()) | 1881 EXPECT_CALL(test_->session(), voice_channel()) |
1882 .WillRepeatedly(Return(&voice_channel)); | 1882 .WillRepeatedly(Return(&voice_channel)); |
1883 | 1883 |
1884 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | 1884 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); |
1885 | 1885 |
1886 RTCOutboundRTPStreamStats expected_audio( | 1886 RTCOutboundRTPStreamStats expected_audio( |
1887 "RTCOutboundRTPAudioStream_1", report->timestamp_us()); | 1887 "RTCOutboundRTPAudioStream_1", report->timestamp_us()); |
1888 expected_audio.ssrc = "1"; | 1888 expected_audio.ssrc = 1; |
1889 expected_audio.is_remote = false; | 1889 expected_audio.is_remote = false; |
1890 expected_audio.media_type = "audio"; | 1890 expected_audio.media_type = "audio"; |
1891 expected_audio.track_id = | 1891 expected_audio.track_id = |
1892 "RTCMediaStreamTrack_local_audio_LocalAudioTrackID_1"; | 1892 "RTCMediaStreamTrack_local_audio_LocalAudioTrackID_1"; |
1893 expected_audio.transport_id = "RTCTransport_TransportName_" + | 1893 expected_audio.transport_id = "RTCTransport_TransportName_" + |
1894 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); | 1894 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); |
1895 expected_audio.codec_id = "RTCCodec_OutboundAudio_42"; | 1895 expected_audio.codec_id = "RTCCodec_OutboundAudio_42"; |
1896 expected_audio.packets_sent = 2; | 1896 expected_audio.packets_sent = 2; |
1897 expected_audio.bytes_sent = 3; | 1897 expected_audio.bytes_sent = 3; |
1898 expected_audio.round_trip_time = 4.5; | 1898 expected_audio.round_trip_time = 4.5; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 [&session_stats](const ChannelNamePairs&) { | 1958 [&session_stats](const ChannelNamePairs&) { |
1959 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); | 1959 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); |
1960 })); | 1960 })); |
1961 EXPECT_CALL(test_->session(), video_channel()) | 1961 EXPECT_CALL(test_->session(), video_channel()) |
1962 .WillRepeatedly(Return(&video_channel)); | 1962 .WillRepeatedly(Return(&video_channel)); |
1963 | 1963 |
1964 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | 1964 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); |
1965 | 1965 |
1966 RTCOutboundRTPStreamStats expected_video( | 1966 RTCOutboundRTPStreamStats expected_video( |
1967 "RTCOutboundRTPVideoStream_1", report->timestamp_us()); | 1967 "RTCOutboundRTPVideoStream_1", report->timestamp_us()); |
1968 expected_video.ssrc = "1"; | 1968 expected_video.ssrc = 1; |
1969 expected_video.is_remote = false; | 1969 expected_video.is_remote = false; |
1970 expected_video.media_type = "video"; | 1970 expected_video.media_type = "video"; |
1971 expected_video.track_id = | 1971 expected_video.track_id = |
1972 "RTCMediaStreamTrack_local_video_LocalVideoTrackID_1"; | 1972 "RTCMediaStreamTrack_local_video_LocalVideoTrackID_1"; |
1973 expected_video.transport_id = "RTCTransport_TransportName_" + | 1973 expected_video.transport_id = "RTCTransport_TransportName_" + |
1974 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); | 1974 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); |
1975 expected_video.codec_id = "RTCCodec_OutboundVideo_42"; | 1975 expected_video.codec_id = "RTCCodec_OutboundVideo_42"; |
1976 expected_video.fir_count = 2; | 1976 expected_video.fir_count = 2; |
1977 expected_video.pli_count = 3; | 1977 expected_video.pli_count = 3; |
1978 expected_video.nack_count = 4; | 1978 expected_video.nack_count = 4; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2049 })); | 2049 })); |
2050 EXPECT_CALL(test_->session(), voice_channel()) | 2050 EXPECT_CALL(test_->session(), voice_channel()) |
2051 .WillRepeatedly(Return(&voice_channel)); | 2051 .WillRepeatedly(Return(&voice_channel)); |
2052 EXPECT_CALL(test_->session(), video_channel()) | 2052 EXPECT_CALL(test_->session(), video_channel()) |
2053 .WillRepeatedly(Return(&video_channel)); | 2053 .WillRepeatedly(Return(&video_channel)); |
2054 | 2054 |
2055 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | 2055 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); |
2056 | 2056 |
2057 RTCOutboundRTPStreamStats expected_audio( | 2057 RTCOutboundRTPStreamStats expected_audio( |
2058 "RTCOutboundRTPAudioStream_1", report->timestamp_us()); | 2058 "RTCOutboundRTPAudioStream_1", report->timestamp_us()); |
2059 expected_audio.ssrc = "1"; | 2059 expected_audio.ssrc = 1; |
2060 expected_audio.is_remote = false; | 2060 expected_audio.is_remote = false; |
2061 expected_audio.media_type = "audio"; | 2061 expected_audio.media_type = "audio"; |
2062 expected_audio.transport_id = "RTCTransport_TransportName_" + | 2062 expected_audio.transport_id = "RTCTransport_TransportName_" + |
2063 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); | 2063 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); |
2064 expected_audio.codec_id = "RTCCodec_OutboundAudio_42"; | 2064 expected_audio.codec_id = "RTCCodec_OutboundAudio_42"; |
2065 expected_audio.packets_sent = 2; | 2065 expected_audio.packets_sent = 2; |
2066 expected_audio.bytes_sent = 3; | 2066 expected_audio.bytes_sent = 3; |
2067 // |expected_audio.round_trip_time| should be undefined. | 2067 // |expected_audio.round_trip_time| should be undefined. |
2068 | 2068 |
2069 ASSERT_TRUE(report->Get(expected_audio.id())); | 2069 ASSERT_TRUE(report->Get(expected_audio.id())); |
2070 const RTCOutboundRTPStreamStats& audio = report->Get( | 2070 const RTCOutboundRTPStreamStats& audio = report->Get( |
2071 expected_audio.id())->cast_to<RTCOutboundRTPStreamStats>(); | 2071 expected_audio.id())->cast_to<RTCOutboundRTPStreamStats>(); |
2072 EXPECT_EQ(audio, expected_audio); | 2072 EXPECT_EQ(audio, expected_audio); |
2073 | 2073 |
2074 RTCOutboundRTPStreamStats expected_video( | 2074 RTCOutboundRTPStreamStats expected_video( |
2075 "RTCOutboundRTPVideoStream_1", report->timestamp_us()); | 2075 "RTCOutboundRTPVideoStream_1", report->timestamp_us()); |
2076 expected_video.ssrc = "1"; | 2076 expected_video.ssrc = 1; |
2077 expected_video.is_remote = false; | 2077 expected_video.is_remote = false; |
2078 expected_video.media_type = "video"; | 2078 expected_video.media_type = "video"; |
2079 expected_video.transport_id = "RTCTransport_TransportName_" + | 2079 expected_video.transport_id = "RTCTransport_TransportName_" + |
2080 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); | 2080 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); |
2081 expected_video.codec_id = "RTCCodec_OutboundVideo_42"; | 2081 expected_video.codec_id = "RTCCodec_OutboundVideo_42"; |
2082 expected_video.fir_count = 2; | 2082 expected_video.fir_count = 2; |
2083 expected_video.pli_count = 3; | 2083 expected_video.pli_count = 3; |
2084 expected_video.nack_count = 4; | 2084 expected_video.nack_count = 4; |
2085 expected_video.packets_sent = 5; | 2085 expected_video.packets_sent = 5; |
2086 expected_video.bytes_sent = 6; | 2086 expected_video.bytes_sent = 6; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; | 2265 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; |
2266 }; | 2266 }; |
2267 | 2267 |
2268 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { | 2268 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { |
2269 collector_->VerifyThreadUsageAndResultsMerging(); | 2269 collector_->VerifyThreadUsageAndResultsMerging(); |
2270 } | 2270 } |
2271 | 2271 |
2272 } // namespace | 2272 } // namespace |
2273 | 2273 |
2274 } // namespace webrtc | 2274 } // namespace webrtc |
OLD | NEW |