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

Side by Side Diff: webrtc/api/rtcstatscollector_unittest.cc

Issue 2597423003: RTCIceCandidatePairStats.[state/priority] added, ConnectionInfo updated. (Closed)
Patch Set: Rebase with master Created 3 years, 11 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 | « webrtc/api/rtcstatscollector.cc ('k') | webrtc/api/stats/rtcstats_objects.h » ('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 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 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 connection_info.remote_candidate = *remote_candidate.get(); 1059 connection_info.remote_candidate = *remote_candidate.get();
1060 connection_info.writable = true; 1060 connection_info.writable = true;
1061 connection_info.sent_total_bytes = 42; 1061 connection_info.sent_total_bytes = 42;
1062 connection_info.recv_total_bytes = 1234; 1062 connection_info.recv_total_bytes = 1234;
1063 connection_info.rtt = 1337; 1063 connection_info.rtt = 1337;
1064 connection_info.recv_ping_requests = 2020; 1064 connection_info.recv_ping_requests = 2020;
1065 connection_info.sent_ping_requests_total = 2020; 1065 connection_info.sent_ping_requests_total = 2020;
1066 connection_info.sent_ping_requests_before_first_response = 2000; 1066 connection_info.sent_ping_requests_before_first_response = 2000;
1067 connection_info.recv_ping_responses = 4321; 1067 connection_info.recv_ping_responses = 4321;
1068 connection_info.sent_ping_responses = 1000; 1068 connection_info.sent_ping_responses = 1000;
1069 connection_info.state = cricket::IceCandidatePairState::IN_PROGRESS;
1070 connection_info.priority = 5555;
1069 1071
1070 cricket::TransportChannelStats transport_channel_stats; 1072 cricket::TransportChannelStats transport_channel_stats;
1071 transport_channel_stats.component = cricket::ICE_CANDIDATE_COMPONENT_RTP; 1073 transport_channel_stats.component = cricket::ICE_CANDIDATE_COMPONENT_RTP;
1072 transport_channel_stats.connection_infos.push_back(connection_info); 1074 transport_channel_stats.connection_infos.push_back(connection_info);
1073 session_stats.transport_stats["transport"].transport_name = "transport"; 1075 session_stats.transport_stats["transport"].transport_name = "transport";
1074 session_stats.transport_stats["transport"].channel_stats.push_back( 1076 session_stats.transport_stats["transport"].channel_stats.push_back(
1075 transport_channel_stats); 1077 transport_channel_stats);
1076 1078
1077 // Mock the session to return the desired candidates. 1079 // Mock the session to return the desired candidates.
1078 EXPECT_CALL(test_->session(), GetStats(_)).WillRepeatedly(Invoke( 1080 EXPECT_CALL(test_->session(), GetStats(_)).WillRepeatedly(Invoke(
1079 [&session_stats](const ChannelNamePairs&) { 1081 [&session_stats](const ChannelNamePairs&) {
1080 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); 1082 return std::unique_ptr<SessionStats>(new SessionStats(session_stats));
1081 })); 1083 }));
1082 1084
1083 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); 1085 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport();
1084 1086
1085 RTCIceCandidatePairStats expected_pair("RTCIceCandidatePair_" + 1087 RTCIceCandidatePairStats expected_pair("RTCIceCandidatePair_" +
1086 local_candidate->id() + "_" + 1088 local_candidate->id() + "_" +
1087 remote_candidate->id(), 1089 remote_candidate->id(),
1088 report->timestamp_us()); 1090 report->timestamp_us());
1089 expected_pair.transport_id = 1091 expected_pair.transport_id =
1090 "RTCTransport_transport_" + 1092 "RTCTransport_transport_" +
1091 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); 1093 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP);
1092 expected_pair.local_candidate_id = "RTCIceCandidate_" + local_candidate->id(); 1094 expected_pair.local_candidate_id = "RTCIceCandidate_" + local_candidate->id();
1093 expected_pair.remote_candidate_id = 1095 expected_pair.remote_candidate_id =
1094 "RTCIceCandidate_" + remote_candidate->id(); 1096 "RTCIceCandidate_" + remote_candidate->id();
1097 expected_pair.state = RTCStatsIceCandidatePairState::kInProgress;
1098 expected_pair.priority = 5555;
1095 expected_pair.writable = true; 1099 expected_pair.writable = true;
1096 expected_pair.bytes_sent = 42; 1100 expected_pair.bytes_sent = 42;
1097 expected_pair.bytes_received = 1234; 1101 expected_pair.bytes_received = 1234;
1098 expected_pair.current_round_trip_time = 1.337; 1102 expected_pair.current_round_trip_time = 1.337;
1099 expected_pair.requests_received = 2020; 1103 expected_pair.requests_received = 2020;
1100 expected_pair.requests_sent = 2000; 1104 expected_pair.requests_sent = 2000;
1101 expected_pair.responses_received = 4321; 1105 expected_pair.responses_received = 4321;
1102 expected_pair.responses_sent = 1000; 1106 expected_pair.responses_sent = 1000;
1103 expected_pair.consent_requests_sent = (2020 - 2000); 1107 expected_pair.consent_requests_sent = (2020 - 2000);
1104 1108
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; 1980 rtc::scoped_refptr<FakeRTCStatsCollector> collector_;
1977 }; 1981 };
1978 1982
1979 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { 1983 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) {
1980 collector_->VerifyThreadUsageAndResultsMerging(); 1984 collector_->VerifyThreadUsageAndResultsMerging();
1981 } 1985 }
1982 1986
1983 } // namespace 1987 } // namespace
1984 1988
1985 } // namespace webrtc 1989 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/rtcstatscollector.cc ('k') | webrtc/api/stats/rtcstats_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698