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

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

Issue 2591963003: RTCIceCandidateStats.deleted = false added. (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/rtcstats_integrationtest.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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 "remote_srflx's protocol", 916 "remote_srflx's protocol",
917 cricket::STUN_PORT_TYPE, 917 cricket::STUN_PORT_TYPE,
918 1); 918 1);
919 RTCRemoteIceCandidateStats expected_a_remote_srflx( 919 RTCRemoteIceCandidateStats expected_a_remote_srflx(
920 "RTCIceCandidate_" + a_remote_srflx->id(), 0); 920 "RTCIceCandidate_" + a_remote_srflx->id(), 0);
921 expected_a_remote_srflx.ip = "6.7.8.9"; 921 expected_a_remote_srflx.ip = "6.7.8.9";
922 expected_a_remote_srflx.port = 10; 922 expected_a_remote_srflx.port = 10;
923 expected_a_remote_srflx.protocol = "remote_srflx's protocol"; 923 expected_a_remote_srflx.protocol = "remote_srflx's protocol";
924 expected_a_remote_srflx.candidate_type = "srflx"; 924 expected_a_remote_srflx.candidate_type = "srflx";
925 expected_a_remote_srflx.priority = 1; 925 expected_a_remote_srflx.priority = 1;
926 expected_a_remote_srflx.deleted = false;
926 EXPECT_TRUE(*expected_a_remote_srflx.is_remote); 927 EXPECT_TRUE(*expected_a_remote_srflx.is_remote);
927 928
928 std::unique_ptr<cricket::Candidate> a_local_prflx = CreateFakeCandidate( 929 std::unique_ptr<cricket::Candidate> a_local_prflx = CreateFakeCandidate(
929 "11.12.13.14", 15, 930 "11.12.13.14", 15,
930 "a_local_prflx's protocol", 931 "a_local_prflx's protocol",
931 cricket::PRFLX_PORT_TYPE, 932 cricket::PRFLX_PORT_TYPE,
932 2); 933 2);
933 RTCLocalIceCandidateStats expected_a_local_prflx( 934 RTCLocalIceCandidateStats expected_a_local_prflx(
934 "RTCIceCandidate_" + a_local_prflx->id(), 0); 935 "RTCIceCandidate_" + a_local_prflx->id(), 0);
935 expected_a_local_prflx.ip = "11.12.13.14"; 936 expected_a_local_prflx.ip = "11.12.13.14";
936 expected_a_local_prflx.port = 15; 937 expected_a_local_prflx.port = 15;
937 expected_a_local_prflx.protocol = "a_local_prflx's protocol"; 938 expected_a_local_prflx.protocol = "a_local_prflx's protocol";
938 expected_a_local_prflx.candidate_type = "prflx"; 939 expected_a_local_prflx.candidate_type = "prflx";
939 expected_a_local_prflx.priority = 2; 940 expected_a_local_prflx.priority = 2;
941 expected_a_local_prflx.deleted = false;
940 EXPECT_FALSE(*expected_a_local_prflx.is_remote); 942 EXPECT_FALSE(*expected_a_local_prflx.is_remote);
941 943
942 std::unique_ptr<cricket::Candidate> a_remote_relay = CreateFakeCandidate( 944 std::unique_ptr<cricket::Candidate> a_remote_relay = CreateFakeCandidate(
943 "16.17.18.19", 20, 945 "16.17.18.19", 20,
944 "a_remote_relay's protocol", 946 "a_remote_relay's protocol",
945 cricket::RELAY_PORT_TYPE, 947 cricket::RELAY_PORT_TYPE,
946 3); 948 3);
947 RTCRemoteIceCandidateStats expected_a_remote_relay( 949 RTCRemoteIceCandidateStats expected_a_remote_relay(
948 "RTCIceCandidate_" + a_remote_relay->id(), 0); 950 "RTCIceCandidate_" + a_remote_relay->id(), 0);
949 expected_a_remote_relay.ip = "16.17.18.19"; 951 expected_a_remote_relay.ip = "16.17.18.19";
950 expected_a_remote_relay.port = 20; 952 expected_a_remote_relay.port = 20;
951 expected_a_remote_relay.protocol = "a_remote_relay's protocol"; 953 expected_a_remote_relay.protocol = "a_remote_relay's protocol";
952 expected_a_remote_relay.candidate_type = "relay"; 954 expected_a_remote_relay.candidate_type = "relay";
953 expected_a_remote_relay.priority = 3; 955 expected_a_remote_relay.priority = 3;
956 expected_a_remote_relay.deleted = false;
954 EXPECT_TRUE(*expected_a_remote_relay.is_remote); 957 EXPECT_TRUE(*expected_a_remote_relay.is_remote);
955 958
956 // Candidates in the second transport stats. 959 // Candidates in the second transport stats.
957 std::unique_ptr<cricket::Candidate> b_local = CreateFakeCandidate( 960 std::unique_ptr<cricket::Candidate> b_local = CreateFakeCandidate(
958 "42.42.42.42", 42, 961 "42.42.42.42", 42,
959 "b_local's protocol", 962 "b_local's protocol",
960 cricket::LOCAL_PORT_TYPE, 963 cricket::LOCAL_PORT_TYPE,
961 42); 964 42);
962 RTCLocalIceCandidateStats expected_b_local( 965 RTCLocalIceCandidateStats expected_b_local(
963 "RTCIceCandidate_" + b_local->id(), 0); 966 "RTCIceCandidate_" + b_local->id(), 0);
964 expected_b_local.ip = "42.42.42.42"; 967 expected_b_local.ip = "42.42.42.42";
965 expected_b_local.port = 42; 968 expected_b_local.port = 42;
966 expected_b_local.protocol = "b_local's protocol"; 969 expected_b_local.protocol = "b_local's protocol";
967 expected_b_local.candidate_type = "host"; 970 expected_b_local.candidate_type = "host";
968 expected_b_local.priority = 42; 971 expected_b_local.priority = 42;
972 expected_b_local.deleted = false;
969 EXPECT_FALSE(*expected_b_local.is_remote); 973 EXPECT_FALSE(*expected_b_local.is_remote);
970 974
971 std::unique_ptr<cricket::Candidate> b_remote = CreateFakeCandidate( 975 std::unique_ptr<cricket::Candidate> b_remote = CreateFakeCandidate(
972 "42.42.42.42", 42, 976 "42.42.42.42", 42,
973 "b_remote's protocol", 977 "b_remote's protocol",
974 cricket::LOCAL_PORT_TYPE, 978 cricket::LOCAL_PORT_TYPE,
975 42); 979 42);
976 RTCRemoteIceCandidateStats expected_b_remote( 980 RTCRemoteIceCandidateStats expected_b_remote(
977 "RTCIceCandidate_" + b_remote->id(), 0); 981 "RTCIceCandidate_" + b_remote->id(), 0);
978 expected_b_remote.ip = "42.42.42.42"; 982 expected_b_remote.ip = "42.42.42.42";
979 expected_b_remote.port = 42; 983 expected_b_remote.port = 42;
980 expected_b_remote.protocol = "b_remote's protocol"; 984 expected_b_remote.protocol = "b_remote's protocol";
981 expected_b_remote.candidate_type = "host"; 985 expected_b_remote.candidate_type = "host";
982 expected_b_remote.priority = 42; 986 expected_b_remote.priority = 42;
987 expected_b_remote.deleted = false;
983 EXPECT_TRUE(*expected_b_remote.is_remote); 988 EXPECT_TRUE(*expected_b_remote.is_remote);
984 989
985 SessionStats session_stats; 990 SessionStats session_stats;
986 991
987 cricket::TransportChannelStats a_transport_channel_stats; 992 cricket::TransportChannelStats a_transport_channel_stats;
988 a_transport_channel_stats.connection_infos.push_back( 993 a_transport_channel_stats.connection_infos.push_back(
989 cricket::ConnectionInfo()); 994 cricket::ConnectionInfo());
990 a_transport_channel_stats.connection_infos[0].local_candidate = 995 a_transport_channel_stats.connection_infos[0].local_candidate =
991 *a_local_host.get(); 996 *a_local_host.get();
992 a_transport_channel_stats.connection_infos[0].remote_candidate = 997 a_transport_channel_stats.connection_infos[0].remote_candidate =
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 expected_pair, 1112 expected_pair,
1108 report->Get(expected_pair.id())->cast_to<RTCIceCandidatePairStats>()); 1113 report->Get(expected_pair.id())->cast_to<RTCIceCandidatePairStats>());
1109 1114
1110 RTCLocalIceCandidateStats expected_local_candidate( 1115 RTCLocalIceCandidateStats expected_local_candidate(
1111 *expected_pair.local_candidate_id, report->timestamp_us()); 1116 *expected_pair.local_candidate_id, report->timestamp_us());
1112 expected_local_candidate.ip = "42.42.42.42"; 1117 expected_local_candidate.ip = "42.42.42.42";
1113 expected_local_candidate.port = 42; 1118 expected_local_candidate.port = 42;
1114 expected_local_candidate.protocol = "protocol"; 1119 expected_local_candidate.protocol = "protocol";
1115 expected_local_candidate.candidate_type = "host"; 1120 expected_local_candidate.candidate_type = "host";
1116 expected_local_candidate.priority = 42; 1121 expected_local_candidate.priority = 42;
1122 expected_local_candidate.deleted = false;
1117 EXPECT_FALSE(*expected_local_candidate.is_remote); 1123 EXPECT_FALSE(*expected_local_candidate.is_remote);
1118 ASSERT_TRUE(report->Get(expected_local_candidate.id())); 1124 ASSERT_TRUE(report->Get(expected_local_candidate.id()));
1119 EXPECT_EQ(expected_local_candidate, 1125 EXPECT_EQ(expected_local_candidate,
1120 report->Get(expected_local_candidate.id())->cast_to< 1126 report->Get(expected_local_candidate.id())->cast_to<
1121 RTCLocalIceCandidateStats>()); 1127 RTCLocalIceCandidateStats>());
1122 1128
1123 RTCRemoteIceCandidateStats expected_remote_candidate( 1129 RTCRemoteIceCandidateStats expected_remote_candidate(
1124 *expected_pair.remote_candidate_id, report->timestamp_us()); 1130 *expected_pair.remote_candidate_id, report->timestamp_us());
1125 expected_remote_candidate.ip = "42.42.42.42"; 1131 expected_remote_candidate.ip = "42.42.42.42";
1126 expected_remote_candidate.port = 42; 1132 expected_remote_candidate.port = 42;
1127 expected_remote_candidate.protocol = "protocol"; 1133 expected_remote_candidate.protocol = "protocol";
1128 expected_remote_candidate.candidate_type = "host"; 1134 expected_remote_candidate.candidate_type = "host";
1129 expected_remote_candidate.priority = 42; 1135 expected_remote_candidate.priority = 42;
1136 expected_remote_candidate.deleted = false;
1130 EXPECT_TRUE(*expected_remote_candidate.is_remote); 1137 EXPECT_TRUE(*expected_remote_candidate.is_remote);
1131 ASSERT_TRUE(report->Get(expected_remote_candidate.id())); 1138 ASSERT_TRUE(report->Get(expected_remote_candidate.id()));
1132 EXPECT_EQ(expected_remote_candidate, 1139 EXPECT_EQ(expected_remote_candidate,
1133 report->Get(expected_remote_candidate.id())->cast_to< 1140 report->Get(expected_remote_candidate.id())->cast_to<
1134 RTCRemoteIceCandidateStats>()); 1141 RTCRemoteIceCandidateStats>());
1135 } 1142 }
1136 1143
1137 TEST_F(RTCStatsCollectorTest, CollectRTCPeerConnectionStats) { 1144 TEST_F(RTCStatsCollectorTest, CollectRTCPeerConnectionStats) {
1138 { 1145 {
1139 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport(); 1146 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport();
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 rtc::scoped_refptr<FakeRTCStatsCollector> collector_; 1983 rtc::scoped_refptr<FakeRTCStatsCollector> collector_;
1977 }; 1984 };
1978 1985
1979 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) { 1986 TEST_F(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) {
1980 collector_->VerifyThreadUsageAndResultsMerging(); 1987 collector_->VerifyThreadUsageAndResultsMerging();
1981 } 1988 }
1982 1989
1983 } // namespace 1990 } // namespace
1984 1991
1985 } // namespace webrtc 1992 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/api/rtcstats_integrationtest.cc ('k') | webrtc/api/stats/rtcstats_objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698