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

Side by Side Diff: webrtc/logging/rtc_event_log/rtc_event_log_unittest_helper.cc

Issue 2808833002: Delay based logging. (Closed)
Patch Set: Unittest fix. Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 ASSERT_TRUE(IsValidBasicEvent(event)); 531 ASSERT_TRUE(IsValidBasicEvent(event));
532 ASSERT_EQ(rtclog::Event::DELAY_BASED_BWE_UPDATE, event.type()); 532 ASSERT_EQ(rtclog::Event::DELAY_BASED_BWE_UPDATE, event.type());
533 const rtclog::DelayBasedBweUpdate& bwe_event = event.delay_based_bwe_update(); 533 const rtclog::DelayBasedBweUpdate& bwe_event = event.delay_based_bwe_update();
534 ASSERT_TRUE(bwe_event.has_bitrate_bps()); 534 ASSERT_TRUE(bwe_event.has_bitrate_bps());
535 EXPECT_EQ(bitrate, bwe_event.bitrate_bps()); 535 EXPECT_EQ(bitrate, bwe_event.bitrate_bps());
536 ASSERT_TRUE(bwe_event.has_detector_state()); 536 ASSERT_TRUE(bwe_event.has_detector_state());
537 EXPECT_EQ(detector_state, 537 EXPECT_EQ(detector_state,
538 GetRuntimeDetectorState(bwe_event.detector_state())); 538 GetRuntimeDetectorState(bwe_event.detector_state()));
539 539
540 // Check consistency of the parser. 540 // Check consistency of the parser.
541 int32_t parsed_bitrate; 541 ParsedRtcEventLog::BweDelayBasedUpdate res =
542 BandwidthUsage parsed_detector_state; 542 parsed_log.GetDelayBasedBweUpdate(index);
543 parsed_log.GetDelayBasedBweUpdate(index, &parsed_bitrate, 543 EXPECT_EQ(res.bitrate_bps, bitrate);
544 &parsed_detector_state); 544 EXPECT_EQ(res.detector_state, detector_state);
545 EXPECT_EQ(bitrate, parsed_bitrate);
546 EXPECT_EQ(detector_state, parsed_detector_state);
547 } 545 }
548 546
549 void RtcEventLogTestHelper::VerifyAudioNetworkAdaptation( 547 void RtcEventLogTestHelper::VerifyAudioNetworkAdaptation(
550 const ParsedRtcEventLog& parsed_log, 548 const ParsedRtcEventLog& parsed_log,
551 size_t index, 549 size_t index,
552 const AudioEncoderRuntimeConfig& config) { 550 const AudioEncoderRuntimeConfig& config) {
553 AudioEncoderRuntimeConfig parsed_config; 551 AudioEncoderRuntimeConfig parsed_config;
554 parsed_log.GetAudioNetworkAdaptation(index, &parsed_config); 552 parsed_log.GetAudioNetworkAdaptation(index, &parsed_config);
555 EXPECT_EQ(config.bitrate_bps, parsed_config.bitrate_bps); 553 EXPECT_EQ(config.bitrate_bps, parsed_config.bitrate_bps);
556 EXPECT_EQ(config.enable_dtx, parsed_config.enable_dtx); 554 EXPECT_EQ(config.enable_dtx, parsed_config.enable_dtx);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 ASSERT_TRUE(bwe_event.has_id()); 632 ASSERT_TRUE(bwe_event.has_id());
635 EXPECT_EQ(id, bwe_event.id()); 633 EXPECT_EQ(id, bwe_event.id());
636 ASSERT_TRUE(bwe_event.has_result()); 634 ASSERT_TRUE(bwe_event.has_result());
637 EXPECT_EQ(GetProbeResultType(failure_reason), bwe_event.result()); 635 EXPECT_EQ(GetProbeResultType(failure_reason), bwe_event.result());
638 ASSERT_FALSE(bwe_event.has_bitrate_bps()); 636 ASSERT_FALSE(bwe_event.has_bitrate_bps());
639 637
640 // TODO(philipel): Verify the parser when parsing has been implemented. 638 // TODO(philipel): Verify the parser when parsing has been implemented.
641 } 639 }
642 640
643 } // namespace webrtc 641 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/logging/rtc_event_log/rtc_event_log_parser.cc ('k') | webrtc/tools/event_log_visualizer/analyzer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698