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

Side by Side Diff: webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc

Issue 2121993002: Added NiceMock for MockRtcEventLog in several unittests where we don't care about the event logging. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 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/modules/congestion_controller/congestion_controller_unittest.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 (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 const int kStartBitrateBps = 200000; 85 const int kStartBitrateBps = 200000;
86 const int kMaxBitrateBps = 300000; 86 const int kMaxBitrateBps = 300000;
87 87
88 const int kDefaultMinBitrateBps = 10000; 88 const int kDefaultMinBitrateBps = 10000;
89 const int kDefaultMaxBitrateBps = 1000000000; 89 const int kDefaultMaxBitrateBps = 1000000000;
90 90
91 webrtc::SimulatedClock clock_; 91 webrtc::SimulatedClock clock_;
92 TestBitrateObserver bitrate_observer_; 92 TestBitrateObserver bitrate_observer_;
93 BitrateController* controller_; 93 BitrateController* controller_;
94 RtcpBandwidthObserver* bandwidth_observer_; 94 RtcpBandwidthObserver* bandwidth_observer_;
95 webrtc::MockRtcEventLog event_log_; 95 testing::NiceMock<webrtc::MockRtcEventLog> event_log_;
stefan-webrtc 2016/07/05 12:16:27 Given this I think you may be able to remove some
ivoc 2016/07/05 12:25:27 Good point, since the purpose of these tests is no
96 }; 96 };
97 97
98 TEST_F(BitrateControllerTest, DefaultMinMaxBitrate) { 98 TEST_F(BitrateControllerTest, DefaultMinMaxBitrate) {
99 // Receive successively lower REMBs, verify the reserved bitrate is deducted. 99 // Receive successively lower REMBs, verify the reserved bitrate is deducted.
100 controller_->SetMinMaxBitrate(0, 0); 100 controller_->SetMinMaxBitrate(0, 0);
101 EXPECT_EQ(kStartBitrateBps, bitrate_observer_.last_bitrate_); 101 EXPECT_EQ(kStartBitrateBps, bitrate_observer_.last_bitrate_);
102 bandwidth_observer_->OnReceivedEstimatedBitrate(kDefaultMinBitrateBps / 2); 102 bandwidth_observer_->OnReceivedEstimatedBitrate(kDefaultMinBitrateBps / 2);
103 EXPECT_EQ(kDefaultMinBitrateBps, bitrate_observer_.last_bitrate_); 103 EXPECT_EQ(kDefaultMinBitrateBps, bitrate_observer_.last_bitrate_);
104 bandwidth_observer_->OnReceivedEstimatedBitrate(2 * kDefaultMaxBitrateBps); 104 bandwidth_observer_->OnReceivedEstimatedBitrate(2 * kDefaultMaxBitrateBps);
105 clock_.AdvanceTimeMilliseconds(1000); 105 clock_.AdvanceTimeMilliseconds(1000);
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 EXPECT_EQ(120000, bitrate_observer_.last_bitrate_); 408 EXPECT_EQ(120000, bitrate_observer_.last_bitrate_);
409 controller_->SetReservedBitrate(50000); 409 controller_->SetReservedBitrate(50000);
410 bandwidth_observer_->OnReceivedEstimatedBitrate(120000); 410 bandwidth_observer_->OnReceivedEstimatedBitrate(120000);
411 // Limited by min bitrate. 411 // Limited by min bitrate.
412 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); 412 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_);
413 413
414 controller_->SetReservedBitrate(10000); 414 controller_->SetReservedBitrate(10000);
415 bandwidth_observer_->OnReceivedEstimatedBitrate(1); 415 bandwidth_observer_->OnReceivedEstimatedBitrate(1);
416 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_); 416 EXPECT_EQ(100000, bitrate_observer_.last_bitrate_);
417 } 417 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/congestion_controller/congestion_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698