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

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

Issue 2577033002: RTCStatsIntegrationTest: TestMemberIsIDReference on all defined IDs. (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 void VerifyRTCRTPStreamStats( 444 void VerifyRTCRTPStreamStats(
445 const RTCRTPStreamStats& stream, RTCStatsVerifier* verifier) { 445 const RTCRTPStreamStats& stream, RTCStatsVerifier* verifier) {
446 verifier->TestMemberIsDefined(stream.ssrc); 446 verifier->TestMemberIsDefined(stream.ssrc);
447 verifier->TestMemberIsUndefined(stream.associate_stats_id); 447 verifier->TestMemberIsUndefined(stream.associate_stats_id);
448 verifier->TestMemberIsDefined(stream.is_remote); 448 verifier->TestMemberIsDefined(stream.is_remote);
449 verifier->TestMemberIsDefined(stream.media_type); 449 verifier->TestMemberIsDefined(stream.media_type);
450 verifier->TestMemberIsUndefined(stream.media_track_id); 450 verifier->TestMemberIsUndefined(stream.media_track_id);
451 verifier->TestMemberIsIDReference( 451 verifier->TestMemberIsIDReference(
452 stream.transport_id, RTCTransportStats::kType); 452 stream.transport_id, RTCTransportStats::kType);
453 verifier->TestMemberIsDefined(stream.codec_id); 453 verifier->TestMemberIsIDReference(stream.codec_id, RTCCodecStats::kType);
454 if (stream.media_type.is_defined() && *stream.media_type == "video") { 454 if (stream.media_type.is_defined() && *stream.media_type == "video") {
455 verifier->TestMemberIsDefined(stream.fir_count); 455 verifier->TestMemberIsDefined(stream.fir_count);
456 verifier->TestMemberIsDefined(stream.pli_count); 456 verifier->TestMemberIsDefined(stream.pli_count);
457 verifier->TestMemberIsDefined(stream.nack_count); 457 verifier->TestMemberIsDefined(stream.nack_count);
458 } else { 458 } else {
459 verifier->TestMemberIsUndefined(stream.fir_count); 459 verifier->TestMemberIsUndefined(stream.fir_count);
460 verifier->TestMemberIsUndefined(stream.pli_count); 460 verifier->TestMemberIsUndefined(stream.pli_count);
461 verifier->TestMemberIsUndefined(stream.nack_count); 461 verifier->TestMemberIsUndefined(stream.nack_count);
462 } 462 }
463 verifier->TestMemberIsUndefined(stream.sli_count); 463 verifier->TestMemberIsUndefined(stream.sli_count);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 } 503 }
504 504
505 bool VerifyRTCTransportStats( 505 bool VerifyRTCTransportStats(
506 const RTCTransportStats& transport) { 506 const RTCTransportStats& transport) {
507 RTCStatsVerifier verifier(report_, &transport); 507 RTCStatsVerifier verifier(report_, &transport);
508 verifier.TestMemberIsDefined(transport.bytes_sent); 508 verifier.TestMemberIsDefined(transport.bytes_sent);
509 verifier.TestMemberIsDefined(transport.bytes_received); 509 verifier.TestMemberIsDefined(transport.bytes_received);
510 verifier.TestMemberIsOptionalIDReference( 510 verifier.TestMemberIsOptionalIDReference(
511 transport.rtcp_transport_stats_id, RTCTransportStats::kType); 511 transport.rtcp_transport_stats_id, RTCTransportStats::kType);
512 verifier.TestMemberIsDefined(transport.active_connection); 512 verifier.TestMemberIsDefined(transport.active_connection);
513 verifier.TestMemberIsDefined(transport.selected_candidate_pair_id); 513 verifier.TestMemberIsIDReference(
514 verifier.TestMemberIsDefined(transport.local_certificate_id); 514 transport.selected_candidate_pair_id, RTCIceCandidatePairStats::kType);
515 verifier.TestMemberIsDefined(transport.remote_certificate_id); 515 verifier.TestMemberIsIDReference(
516 transport.local_certificate_id, RTCCertificateStats::kType);
517 verifier.TestMemberIsIDReference(
518 transport.remote_certificate_id, RTCCertificateStats::kType);
516 return verifier.ExpectAllMembersSuccessfullyTested(); 519 return verifier.ExpectAllMembersSuccessfullyTested();
517 } 520 }
518 521
519 private: 522 private:
520 rtc::scoped_refptr<const RTCStatsReport> report_; 523 rtc::scoped_refptr<const RTCStatsReport> report_;
521 }; 524 };
522 525
523 TEST_F(RTCStatsIntegrationTest, GetStatsFromCaller) { 526 TEST_F(RTCStatsIntegrationTest, GetStatsFromCaller) {
524 StartCall(); 527 StartCall();
525 528
526 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCaller(); 529 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCaller();
527 RTCStatsReportVerifier(report.get()).VerifyReport(); 530 RTCStatsReportVerifier(report.get()).VerifyReport();
528 } 531 }
529 532
530 TEST_F(RTCStatsIntegrationTest, GetStatsFromCallee) { 533 TEST_F(RTCStatsIntegrationTest, GetStatsFromCallee) {
531 StartCall(); 534 StartCall();
532 535
533 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee(); 536 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
534 RTCStatsReportVerifier(report.get()).VerifyReport(); 537 RTCStatsReportVerifier(report.get()).VerifyReport();
535 } 538 }
536 539
537 } // namespace 540 } // namespace
538 541
539 } // namespace webrtc 542 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698