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

Unified Diff: webrtc/pc/rtcstats_integrationtest.cc

Issue 2675923002: RTCIceCandidatePairStats.available[Outgoing/Incoming]Bitrate collected. (Closed)
Patch Set: Rebase with master Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/stats/rtcstats_objects.h ('k') | webrtc/pc/rtcstatscollector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/rtcstats_integrationtest.cc
diff --git a/webrtc/pc/rtcstats_integrationtest.cc b/webrtc/pc/rtcstats_integrationtest.cc
index 577504728786c476bad527e76bb3c54921859feb..a20a909f1a7d1973a50525ec2b63f2becfb24fcc 100644
--- a/webrtc/pc/rtcstats_integrationtest.cc
+++ b/webrtc/pc/rtcstats_integrationtest.cc
@@ -259,6 +259,11 @@ class RTCStatsReportVerifier {
void VerifyReport() {
std::set<const char*> missing_stats = StatsTypes();
bool verify_successful = true;
+ std::vector<const RTCTransportStats*> transport_stats =
+ report_->GetStatsOfType<RTCTransportStats>();
+ EXPECT_EQ(transport_stats.size(), 1);
+ std::string selected_candidate_pair_id =
+ *transport_stats[0]->selected_candidate_pair_id;
for (const RTCStats& stats : *report_) {
missing_stats.erase(stats.type());
if (stats.type() == RTCCertificateStats::kType) {
@@ -272,7 +277,8 @@ class RTCStatsReportVerifier {
stats.cast_to<RTCDataChannelStats>());
} else if (stats.type() == RTCIceCandidatePairStats::kType) {
verify_successful &= VerifyRTCIceCandidatePairStats(
- stats.cast_to<RTCIceCandidatePairStats>());
+ stats.cast_to<RTCIceCandidatePairStats>(),
+ stats.id() == selected_candidate_pair_id);
} else if (stats.type() == RTCLocalIceCandidateStats::kType) {
verify_successful &= VerifyRTCLocalIceCandidateStats(
stats.cast_to<RTCLocalIceCandidateStats>());
@@ -351,7 +357,7 @@ class RTCStatsReportVerifier {
}
bool VerifyRTCIceCandidatePairStats(
- const RTCIceCandidatePairStats& candidate_pair) {
+ const RTCIceCandidatePairStats& candidate_pair, bool is_selected_pair) {
RTCStatsVerifier verifier(report_, &candidate_pair);
verifier.TestMemberIsIDReference(
candidate_pair.transport_id, RTCTransportStats::kType);
@@ -369,7 +375,12 @@ class RTCStatsReportVerifier {
verifier.TestMemberIsUndefined(candidate_pair.total_round_trip_time);
verifier.TestMemberIsNonNegative<double>(
candidate_pair.current_round_trip_time);
- verifier.TestMemberIsUndefined(candidate_pair.available_outgoing_bitrate);
+ if (is_selected_pair) {
+ verifier.TestMemberIsNonNegative<double>(
+ candidate_pair.available_outgoing_bitrate);
+ } else {
+ verifier.TestMemberIsUndefined(candidate_pair.available_outgoing_bitrate);
+ }
verifier.TestMemberIsUndefined(candidate_pair.available_incoming_bitrate);
verifier.TestMemberIsNonNegative<uint64_t>(
candidate_pair.requests_received);
« no previous file with comments | « webrtc/api/stats/rtcstats_objects.h ('k') | webrtc/pc/rtcstatscollector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698