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

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

Issue 2588373005: RTC[In/Out]boundRTPStreamStats: qpSum,framesDecoded,framesEncoded added. (Closed)
Patch Set: Created 3 years, 12 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') | webrtc/api/rtcstatscollector.cc » ('J')
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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
464 } 464 }
465 465
466 bool VerifyRTCInboundRTPStreamStats( 466 bool VerifyRTCInboundRTPStreamStats(
467 const RTCInboundRTPStreamStats& inbound_stream) { 467 const RTCInboundRTPStreamStats& inbound_stream) {
468 RTCStatsVerifier verifier(report_, &inbound_stream); 468 RTCStatsVerifier verifier(report_, &inbound_stream);
469 VerifyRTCRTPStreamStats(inbound_stream, &verifier); 469 VerifyRTCRTPStreamStats(inbound_stream, &verifier);
470 verifier.TestMemberIsUndefined(inbound_stream.qp_sum);
470 verifier.TestMemberIsDefined(inbound_stream.packets_received); 471 verifier.TestMemberIsDefined(inbound_stream.packets_received);
471 verifier.TestMemberIsDefined(inbound_stream.bytes_received); 472 verifier.TestMemberIsDefined(inbound_stream.bytes_received);
472 verifier.TestMemberIsDefined(inbound_stream.packets_lost); 473 verifier.TestMemberIsDefined(inbound_stream.packets_lost);
473 if (inbound_stream.media_type.is_defined() && 474 if (inbound_stream.media_type.is_defined() &&
474 *inbound_stream.media_type == "video") { 475 *inbound_stream.media_type == "video") {
475 verifier.TestMemberIsUndefined(inbound_stream.jitter); 476 verifier.TestMemberIsUndefined(inbound_stream.jitter);
476 } else { 477 } else {
477 verifier.TestMemberIsDefined(inbound_stream.jitter); 478 verifier.TestMemberIsDefined(inbound_stream.jitter);
478 } 479 }
479 verifier.TestMemberIsDefined(inbound_stream.fraction_lost); 480 verifier.TestMemberIsDefined(inbound_stream.fraction_lost);
480 verifier.TestMemberIsUndefined(inbound_stream.packets_discarded); 481 verifier.TestMemberIsUndefined(inbound_stream.packets_discarded);
481 verifier.TestMemberIsUndefined(inbound_stream.packets_repaired); 482 verifier.TestMemberIsUndefined(inbound_stream.packets_repaired);
482 verifier.TestMemberIsUndefined(inbound_stream.burst_packets_lost); 483 verifier.TestMemberIsUndefined(inbound_stream.burst_packets_lost);
483 verifier.TestMemberIsUndefined(inbound_stream.burst_packets_discarded); 484 verifier.TestMemberIsUndefined(inbound_stream.burst_packets_discarded);
484 verifier.TestMemberIsUndefined(inbound_stream.burst_loss_count); 485 verifier.TestMemberIsUndefined(inbound_stream.burst_loss_count);
485 verifier.TestMemberIsUndefined(inbound_stream.burst_discard_count); 486 verifier.TestMemberIsUndefined(inbound_stream.burst_discard_count);
486 verifier.TestMemberIsUndefined(inbound_stream.burst_loss_rate); 487 verifier.TestMemberIsUndefined(inbound_stream.burst_loss_rate);
487 verifier.TestMemberIsUndefined(inbound_stream.burst_discard_rate); 488 verifier.TestMemberIsUndefined(inbound_stream.burst_discard_rate);
488 verifier.TestMemberIsUndefined(inbound_stream.gap_loss_rate); 489 verifier.TestMemberIsUndefined(inbound_stream.gap_loss_rate);
489 verifier.TestMemberIsUndefined(inbound_stream.gap_discard_rate); 490 verifier.TestMemberIsUndefined(inbound_stream.gap_discard_rate);
491 if (inbound_stream.media_type.is_defined() &&
492 *inbound_stream.media_type == "video") {
493 verifier.TestMemberIsDefined(inbound_stream.frames_decoded);
494 } else {
495 verifier.TestMemberIsUndefined(inbound_stream.frames_decoded);
496 }
490 return verifier.ExpectAllMembersSuccessfullyTested(); 497 return verifier.ExpectAllMembersSuccessfullyTested();
491 } 498 }
492 499
493 bool VerifyRTCOutboundRTPStreamStats( 500 bool VerifyRTCOutboundRTPStreamStats(
494 const RTCOutboundRTPStreamStats& outbound_stream) { 501 const RTCOutboundRTPStreamStats& outbound_stream) {
495 RTCStatsVerifier verifier(report_, &outbound_stream); 502 RTCStatsVerifier verifier(report_, &outbound_stream);
496 VerifyRTCRTPStreamStats(outbound_stream, &verifier); 503 VerifyRTCRTPStreamStats(outbound_stream, &verifier);
504 if (outbound_stream.media_type.is_defined() &&
505 *outbound_stream.media_type == "video") {
506 verifier.TestMemberIsDefined(outbound_stream.qp_sum);
507 } else {
508 verifier.TestMemberIsUndefined(outbound_stream.qp_sum);
509 }
497 verifier.TestMemberIsDefined(outbound_stream.packets_sent); 510 verifier.TestMemberIsDefined(outbound_stream.packets_sent);
498 verifier.TestMemberIsDefined(outbound_stream.bytes_sent); 511 verifier.TestMemberIsDefined(outbound_stream.bytes_sent);
499 verifier.TestMemberIsUndefined(outbound_stream.target_bitrate); 512 verifier.TestMemberIsUndefined(outbound_stream.target_bitrate);
500 // TODO(hbos): Defined in video but not audio case. Why? crbug.com/669877 513 // TODO(hbos): Defined in video but not audio case. Why? crbug.com/669877
501 verifier.MarkMemberTested(outbound_stream.round_trip_time, true); 514 verifier.MarkMemberTested(outbound_stream.round_trip_time, true);
515 if (outbound_stream.media_type.is_defined() &&
516 *outbound_stream.media_type == "video") {
517 verifier.TestMemberIsDefined(outbound_stream.frames_encoded);
518 } else {
519 verifier.TestMemberIsUndefined(outbound_stream.frames_encoded);
520 }
502 return verifier.ExpectAllMembersSuccessfullyTested(); 521 return verifier.ExpectAllMembersSuccessfullyTested();
503 } 522 }
504 523
505 bool VerifyRTCTransportStats( 524 bool VerifyRTCTransportStats(
506 const RTCTransportStats& transport) { 525 const RTCTransportStats& transport) {
507 RTCStatsVerifier verifier(report_, &transport); 526 RTCStatsVerifier verifier(report_, &transport);
508 verifier.TestMemberIsDefined(transport.bytes_sent); 527 verifier.TestMemberIsDefined(transport.bytes_sent);
509 verifier.TestMemberIsDefined(transport.bytes_received); 528 verifier.TestMemberIsDefined(transport.bytes_received);
510 verifier.TestMemberIsOptionalIDReference( 529 verifier.TestMemberIsOptionalIDReference(
511 transport.rtcp_transport_stats_id, RTCTransportStats::kType); 530 transport.rtcp_transport_stats_id, RTCTransportStats::kType);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 // This will destroy the peer connection. 565 // This will destroy the peer connection.
547 caller_ = nullptr; 566 caller_ = nullptr;
548 // Any pending stats requests should have completed in the act of destroying 567 // Any pending stats requests should have completed in the act of destroying
549 // the peer connection. 568 // the peer connection.
550 EXPECT_TRUE(stats_obtainer->report()); 569 EXPECT_TRUE(stats_obtainer->report());
551 } 570 }
552 571
553 } // namespace 572 } // namespace
554 573
555 } // namespace webrtc 574 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/rtcstatscollector.cc » ('j') | webrtc/api/rtcstatscollector.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698