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

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

Issue 2588373005: RTC[In/Out]boundRTPStreamStats: qpSum,framesDecoded,framesEncoded 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 | « no previous file | webrtc/api/rtcstatscollector.cc » ('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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 verifier->TestMemberIsUndefined(stream.pli_count); 501 verifier->TestMemberIsUndefined(stream.pli_count);
502 verifier->TestMemberIsUndefined(stream.nack_count); 502 verifier->TestMemberIsUndefined(stream.nack_count);
503 } 503 }
504 verifier->TestMemberIsUndefined(stream.sli_count); 504 verifier->TestMemberIsUndefined(stream.sli_count);
505 } 505 }
506 506
507 bool VerifyRTCInboundRTPStreamStats( 507 bool VerifyRTCInboundRTPStreamStats(
508 const RTCInboundRTPStreamStats& inbound_stream) { 508 const RTCInboundRTPStreamStats& inbound_stream) {
509 RTCStatsVerifier verifier(report_, &inbound_stream); 509 RTCStatsVerifier verifier(report_, &inbound_stream);
510 VerifyRTCRTPStreamStats(inbound_stream, &verifier); 510 VerifyRTCRTPStreamStats(inbound_stream, &verifier);
511 verifier.TestMemberIsUndefined(inbound_stream.qp_sum);
511 verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.packets_received); 512 verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.packets_received);
512 verifier.TestMemberIsNonNegative<uint64_t>(inbound_stream.bytes_received); 513 verifier.TestMemberIsNonNegative<uint64_t>(inbound_stream.bytes_received);
513 verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.packets_lost); 514 verifier.TestMemberIsNonNegative<uint32_t>(inbound_stream.packets_lost);
514 if (inbound_stream.media_type.is_defined() && 515 if (inbound_stream.media_type.is_defined() &&
515 *inbound_stream.media_type == "video") { 516 *inbound_stream.media_type == "video") {
516 verifier.TestMemberIsUndefined(inbound_stream.jitter); 517 verifier.TestMemberIsUndefined(inbound_stream.jitter);
517 } else { 518 } else {
518 verifier.TestMemberIsNonNegative<double>(inbound_stream.jitter); 519 verifier.TestMemberIsNonNegative<double>(inbound_stream.jitter);
519 } 520 }
520 verifier.TestMemberIsNonNegative<double>(inbound_stream.fraction_lost); 521 verifier.TestMemberIsNonNegative<double>(inbound_stream.fraction_lost);
521 verifier.TestMemberIsUndefined(inbound_stream.packets_discarded); 522 verifier.TestMemberIsUndefined(inbound_stream.packets_discarded);
522 verifier.TestMemberIsUndefined(inbound_stream.packets_repaired); 523 verifier.TestMemberIsUndefined(inbound_stream.packets_repaired);
523 verifier.TestMemberIsUndefined(inbound_stream.burst_packets_lost); 524 verifier.TestMemberIsUndefined(inbound_stream.burst_packets_lost);
524 verifier.TestMemberIsUndefined(inbound_stream.burst_packets_discarded); 525 verifier.TestMemberIsUndefined(inbound_stream.burst_packets_discarded);
525 verifier.TestMemberIsUndefined(inbound_stream.burst_loss_count); 526 verifier.TestMemberIsUndefined(inbound_stream.burst_loss_count);
526 verifier.TestMemberIsUndefined(inbound_stream.burst_discard_count); 527 verifier.TestMemberIsUndefined(inbound_stream.burst_discard_count);
527 verifier.TestMemberIsUndefined(inbound_stream.burst_loss_rate); 528 verifier.TestMemberIsUndefined(inbound_stream.burst_loss_rate);
528 verifier.TestMemberIsUndefined(inbound_stream.burst_discard_rate); 529 verifier.TestMemberIsUndefined(inbound_stream.burst_discard_rate);
529 verifier.TestMemberIsUndefined(inbound_stream.gap_loss_rate); 530 verifier.TestMemberIsUndefined(inbound_stream.gap_loss_rate);
530 verifier.TestMemberIsUndefined(inbound_stream.gap_discard_rate); 531 verifier.TestMemberIsUndefined(inbound_stream.gap_discard_rate);
532 if (inbound_stream.media_type.is_defined() &&
533 *inbound_stream.media_type == "video") {
534 verifier.TestMemberIsDefined(inbound_stream.frames_decoded);
535 } else {
536 verifier.TestMemberIsUndefined(inbound_stream.frames_decoded);
537 }
531 return verifier.ExpectAllMembersSuccessfullyTested(); 538 return verifier.ExpectAllMembersSuccessfullyTested();
532 } 539 }
533 540
534 bool VerifyRTCOutboundRTPStreamStats( 541 bool VerifyRTCOutboundRTPStreamStats(
535 const RTCOutboundRTPStreamStats& outbound_stream) { 542 const RTCOutboundRTPStreamStats& outbound_stream) {
536 RTCStatsVerifier verifier(report_, &outbound_stream); 543 RTCStatsVerifier verifier(report_, &outbound_stream);
537 VerifyRTCRTPStreamStats(outbound_stream, &verifier); 544 VerifyRTCRTPStreamStats(outbound_stream, &verifier);
545 if (outbound_stream.media_type.is_defined() &&
546 *outbound_stream.media_type == "video") {
547 verifier.TestMemberIsNonNegative<uint64_t>(outbound_stream.qp_sum);
548 } else {
549 verifier.TestMemberIsUndefined(outbound_stream.qp_sum);
sakal 2017/01/09 07:13:55 nit: QP sum should also be undefined if frames_enc
hbos 2017/01/09 08:47:57 Ah, I should change below: verifier.TestMemberIsDe
550 }
538 verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.packets_sent); 551 verifier.TestMemberIsNonNegative<uint32_t>(outbound_stream.packets_sent);
539 verifier.TestMemberIsNonNegative<uint64_t>(outbound_stream.bytes_sent); 552 verifier.TestMemberIsNonNegative<uint64_t>(outbound_stream.bytes_sent);
540 verifier.TestMemberIsUndefined(outbound_stream.target_bitrate); 553 verifier.TestMemberIsUndefined(outbound_stream.target_bitrate);
541 // TODO(hbos): Defined in video but not audio case. Why? crbug.com/669877 554 // TODO(hbos): Defined in video but not audio case. Why? crbug.com/669877
542 verifier.MarkMemberTested(outbound_stream.round_trip_time, true); 555 verifier.MarkMemberTested(outbound_stream.round_trip_time, true);
556 if (outbound_stream.media_type.is_defined() &&
557 *outbound_stream.media_type == "video") {
558 verifier.TestMemberIsDefined(outbound_stream.frames_encoded);
559 } else {
560 verifier.TestMemberIsUndefined(outbound_stream.frames_encoded);
561 }
543 return verifier.ExpectAllMembersSuccessfullyTested(); 562 return verifier.ExpectAllMembersSuccessfullyTested();
544 } 563 }
545 564
546 bool VerifyRTCTransportStats( 565 bool VerifyRTCTransportStats(
547 const RTCTransportStats& transport) { 566 const RTCTransportStats& transport) {
548 RTCStatsVerifier verifier(report_, &transport); 567 RTCStatsVerifier verifier(report_, &transport);
549 verifier.TestMemberIsNonNegative<uint64_t>(transport.bytes_sent); 568 verifier.TestMemberIsNonNegative<uint64_t>(transport.bytes_sent);
550 verifier.TestMemberIsNonNegative<uint64_t>(transport.bytes_received); 569 verifier.TestMemberIsNonNegative<uint64_t>(transport.bytes_received);
551 verifier.TestMemberIsOptionalIDReference( 570 verifier.TestMemberIsOptionalIDReference(
552 transport.rtcp_transport_stats_id, RTCTransportStats::kType); 571 transport.rtcp_transport_stats_id, RTCTransportStats::kType);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 caller_ = nullptr; 608 caller_ = nullptr;
590 // Any pending stats requests should have completed in the act of destroying 609 // Any pending stats requests should have completed in the act of destroying
591 // the peer connection. 610 // the peer connection.
592 EXPECT_TRUE(stats_obtainer->report()); 611 EXPECT_TRUE(stats_obtainer->report());
593 } 612 }
594 #endif // HAVE_SCTP 613 #endif // HAVE_SCTP
595 614
596 } // namespace 615 } // namespace
597 616
598 } // namespace webrtc 617 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/rtcstatscollector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698