Chromium Code Reviews| 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1071 connection_info.remote_candidate = *remote_candidate.get(); | 1071 connection_info.remote_candidate = *remote_candidate.get(); |
| 1072 connection_info.writable = true; | 1072 connection_info.writable = true; |
| 1073 connection_info.sent_total_bytes = 42; | 1073 connection_info.sent_total_bytes = 42; |
| 1074 connection_info.recv_total_bytes = 1234; | 1074 connection_info.recv_total_bytes = 1234; |
| 1075 connection_info.rtt = 1337; | 1075 connection_info.rtt = 1337; |
| 1076 connection_info.recv_ping_requests = 2020; | 1076 connection_info.recv_ping_requests = 2020; |
| 1077 connection_info.sent_ping_requests_total = 2020; | 1077 connection_info.sent_ping_requests_total = 2020; |
| 1078 connection_info.sent_ping_requests_before_first_response = 2000; | 1078 connection_info.sent_ping_requests_before_first_response = 2000; |
| 1079 connection_info.recv_ping_responses = 4321; | 1079 connection_info.recv_ping_responses = 4321; |
| 1080 connection_info.sent_ping_responses = 1000; | 1080 connection_info.sent_ping_responses = 1000; |
| 1081 connection_info.state = cricket::IceCandidatePairState::IN_PROGRESS; | |
| 1082 connection_info.priority = 5555; | |
| 1081 | 1083 |
| 1082 cricket::TransportChannelStats transport_channel_stats; | 1084 cricket::TransportChannelStats transport_channel_stats; |
| 1083 transport_channel_stats.component = cricket::ICE_CANDIDATE_COMPONENT_RTP; | 1085 transport_channel_stats.component = cricket::ICE_CANDIDATE_COMPONENT_RTP; |
| 1084 transport_channel_stats.connection_infos.push_back(connection_info); | 1086 transport_channel_stats.connection_infos.push_back(connection_info); |
| 1085 session_stats.transport_stats["transport"].transport_name = "transport"; | 1087 session_stats.transport_stats["transport"].transport_name = "transport"; |
| 1086 session_stats.transport_stats["transport"].channel_stats.push_back( | 1088 session_stats.transport_stats["transport"].channel_stats.push_back( |
| 1087 transport_channel_stats); | 1089 transport_channel_stats); |
| 1088 | 1090 |
| 1089 // Mock the session to return the desired candidates. | 1091 // Mock the session to return the desired candidates. |
| 1090 EXPECT_CALL(test_->session(), GetStats(_)).WillRepeatedly(Invoke( | 1092 EXPECT_CALL(test_->session(), GetStats(_)).WillRepeatedly(Invoke( |
| 1091 [&session_stats](const ChannelNamePairs&) { | 1093 [&session_stats](const ChannelNamePairs&) { |
| 1092 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); | 1094 return std::unique_ptr<SessionStats>(new SessionStats(session_stats)); |
| 1093 })); | 1095 })); |
| 1094 | 1096 |
| 1095 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); | 1097 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); |
| 1096 | 1098 |
| 1097 RTCIceCandidatePairStats expected_pair("RTCIceCandidatePair_" + | 1099 RTCIceCandidatePairStats expected_pair("RTCIceCandidatePair_" + |
| 1098 local_candidate->id() + "_" + | 1100 local_candidate->id() + "_" + |
| 1099 remote_candidate->id(), | 1101 remote_candidate->id(), |
| 1100 report->timestamp_us()); | 1102 report->timestamp_us()); |
| 1101 expected_pair.transport_id = | 1103 expected_pair.transport_id = |
| 1102 "RTCTransport_transport_" + | 1104 "RTCTransport_transport_" + |
| 1103 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); | 1105 rtc::ToString<>(cricket::ICE_CANDIDATE_COMPONENT_RTP); |
| 1104 expected_pair.local_candidate_id = "RTCIceCandidate_" + local_candidate->id(); | 1106 expected_pair.local_candidate_id = "RTCIceCandidate_" + local_candidate->id(); |
| 1105 expected_pair.remote_candidate_id = | 1107 expected_pair.remote_candidate_id = |
| 1106 "RTCIceCandidate_" + remote_candidate->id(); | 1108 "RTCIceCandidate_" + remote_candidate->id(); |
| 1109 expected_pair.state = "in-progress"; | |
|
hbos
2016/12/23 13:45:34
nit: RTCStatsIceCandidatePairState::kInProgress in
hbos
2016/12/27 10:24:34
Done.
| |
| 1110 expected_pair.priority = 5555; | |
| 1107 expected_pair.writable = true; | 1111 expected_pair.writable = true; |
| 1108 expected_pair.bytes_sent = 42; | 1112 expected_pair.bytes_sent = 42; |
| 1109 expected_pair.bytes_received = 1234; | 1113 expected_pair.bytes_received = 1234; |
| 1110 expected_pair.current_round_trip_time = 1.337; | 1114 expected_pair.current_round_trip_time = 1.337; |
| 1111 expected_pair.requests_received = 2020; | 1115 expected_pair.requests_received = 2020; |
| 1112 expected_pair.requests_sent = 2000; | 1116 expected_pair.requests_sent = 2000; |
| 1113 expected_pair.responses_received = 4321; | 1117 expected_pair.responses_received = 4321; |
| 1114 expected_pair.responses_sent = 1000; | 1118 expected_pair.responses_sent = 1000; |
| 1115 expected_pair.consent_requests_sent = (2020 - 2000); | 1119 expected_pair.consent_requests_sent = (2020 - 2000); |
| 1116 | 1120 |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1986 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; | 1990 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; |
| 1987 }; | 1991 }; |
| 1988 | 1992 |
| 1989 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { | 1993 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { |
| 1990 collector_->VerifyThreadUsageAndResultsMerging(); | 1994 collector_->VerifyThreadUsageAndResultsMerging(); |
| 1991 } | 1995 } |
| 1992 | 1996 |
| 1993 } // namespace | 1997 } // namespace |
| 1994 | 1998 |
| 1995 } // namespace webrtc | 1999 } // namespace webrtc |
| OLD | NEW |