OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2014 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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 webrtc::StatsCollector* stats, | 611 webrtc::StatsCollector* stats, |
612 cricket::VoiceChannel* voice_channel, | 612 cricket::VoiceChannel* voice_channel, |
613 const std::string& vc_name, | 613 const std::string& vc_name, |
614 MockVoiceMediaChannel* media_channel, | 614 MockVoiceMediaChannel* media_channel, |
615 cricket::VoiceSenderInfo* voice_sender_info, | 615 cricket::VoiceSenderInfo* voice_sender_info, |
616 cricket::VoiceReceiverInfo* voice_receiver_info, | 616 cricket::VoiceReceiverInfo* voice_receiver_info, |
617 cricket::VoiceMediaInfo* stats_read, | 617 cricket::VoiceMediaInfo* stats_read, |
618 StatsReports* reports) { | 618 StatsReports* reports) { |
619 // A track can't have both sender report and recv report at the same time | 619 // A track can't have both sender report and recv report at the same time |
620 // for now, this might change in the future though. | 620 // for now, this might change in the future though. |
621 ASSERT((voice_sender_info == NULL) ^ (voice_receiver_info == NULL)); | 621 EXPECT_TRUE((voice_sender_info == NULL) ^ (voice_receiver_info == NULL)); |
622 | 622 |
623 // Instruct the session to return stats containing the transport channel. | 623 // Instruct the session to return stats containing the transport channel. |
624 InitSessionStats(vc_name); | 624 InitSessionStats(vc_name); |
625 EXPECT_CALL(session_, GetStats(_)).WillRepeatedly(Invoke( | 625 EXPECT_CALL(session_, GetStats(_)).WillRepeatedly(Invoke( |
626 [this](const ChannelNamePairs&) { | 626 [this](const ChannelNamePairs&) { |
627 return std::unique_ptr<SessionStats>( | 627 return std::unique_ptr<SessionStats>( |
628 new SessionStats(session_stats_)); | 628 new SessionStats(session_stats_)); |
629 })); | 629 })); |
630 | 630 |
631 // Constructs an ssrc stats update. | 631 // Constructs an ssrc stats update. |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 const char local_ip[] = "192.168.0.1"; | 1308 const char local_ip[] = "192.168.0.1"; |
1309 const int remote_port = 2001; | 1309 const int remote_port = 2001; |
1310 const char remote_ip[] = "192.168.0.2"; | 1310 const char remote_ip[] = "192.168.0.2"; |
1311 | 1311 |
1312 rtc::SocketAddress local_address(local_ip, local_port); | 1312 rtc::SocketAddress local_address(local_ip, local_port); |
1313 rtc::SocketAddress remote_address(remote_ip, remote_port); | 1313 rtc::SocketAddress remote_address(remote_ip, remote_port); |
1314 rtc::AdapterType network_type = rtc::ADAPTER_TYPE_ETHERNET; | 1314 rtc::AdapterType network_type = rtc::ADAPTER_TYPE_ETHERNET; |
1315 uint32_t priority = 1000; | 1315 uint32_t priority = 1000; |
1316 | 1316 |
1317 cricket::Candidate c; | 1317 cricket::Candidate c; |
1318 ASSERT(c.id().length() > 0); | 1318 EXPECT_GT(c.id().length(), 0u); |
1319 c.set_type(cricket::LOCAL_PORT_TYPE); | 1319 c.set_type(cricket::LOCAL_PORT_TYPE); |
1320 c.set_protocol(cricket::UDP_PROTOCOL_NAME); | 1320 c.set_protocol(cricket::UDP_PROTOCOL_NAME); |
1321 c.set_address(local_address); | 1321 c.set_address(local_address); |
1322 c.set_priority(priority); | 1322 c.set_priority(priority); |
1323 c.set_network_type(network_type); | 1323 c.set_network_type(network_type); |
1324 std::string report_id = AddCandidateReport(&stats, c, true)->id()->ToString(); | 1324 std::string report_id = AddCandidateReport(&stats, c, true)->id()->ToString(); |
1325 EXPECT_EQ("Cand-" + c.id(), report_id); | 1325 EXPECT_EQ("Cand-" + c.id(), report_id); |
1326 | 1326 |
1327 c = cricket::Candidate(); | 1327 c = cricket::Candidate(); |
1328 ASSERT(c.id().length() > 0); | 1328 EXPECT_GT(c.id().length(), 0u); |
1329 c.set_type(cricket::PRFLX_PORT_TYPE); | 1329 c.set_type(cricket::PRFLX_PORT_TYPE); |
1330 c.set_protocol(cricket::UDP_PROTOCOL_NAME); | 1330 c.set_protocol(cricket::UDP_PROTOCOL_NAME); |
1331 c.set_address(remote_address); | 1331 c.set_address(remote_address); |
1332 c.set_priority(priority); | 1332 c.set_priority(priority); |
1333 c.set_network_type(network_type); | 1333 c.set_network_type(network_type); |
1334 report_id = AddCandidateReport(&stats, c, false)->id()->ToString(); | 1334 report_id = AddCandidateReport(&stats, c, false)->id()->ToString(); |
1335 EXPECT_EQ("Cand-" + c.id(), report_id); | 1335 EXPECT_EQ("Cand-" + c.id(), report_id); |
1336 | 1336 |
1337 stats.GetStats(NULL, &reports); | 1337 stats.GetStats(NULL, &reports); |
1338 | 1338 |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 EXPECT_CALL(*media_channel, GetStats(_)) | 2026 EXPECT_CALL(*media_channel, GetStats(_)) |
2027 .WillOnce(DoAll(SetArgPointee<0>(stats_read), Return(true))); | 2027 .WillOnce(DoAll(SetArgPointee<0>(stats_read), Return(true))); |
2028 stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard); | 2028 stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard); |
2029 stats.GetStats(NULL, &reports); | 2029 stats.GetStats(NULL, &reports); |
2030 EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded), | 2030 EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded), |
2031 ExtractSsrcStatsValue(reports, | 2031 ExtractSsrcStatsValue(reports, |
2032 StatsReport::kStatsValueNameFramesDecoded)); | 2032 StatsReport::kStatsValueNameFramesDecoded)); |
2033 } | 2033 } |
2034 | 2034 |
2035 } // namespace webrtc | 2035 } // namespace webrtc |
OLD | NEW |