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

Side by Side Diff: webrtc/modules/congestion_controller/probing_interval_estimator_unittest.cc

Issue 2518923003: Pass time constant to bwe smoothing filter. (Closed)
Patch Set: Respond to comments. 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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 TEST(ProbingIntervalEstimatorTest, NoIntervalUntillWeHaveDrop) { 42 TEST(ProbingIntervalEstimatorTest, NoIntervalUntillWeHaveDrop) {
43 auto states = CreateProbingIntervalEstimatorStates(); 43 auto states = CreateProbingIntervalEstimatorStates();
44 44
45 EXPECT_CALL(*states.aimd_rate_control, GetLastBitrateDecreaseBps()) 45 EXPECT_CALL(*states.aimd_rate_control, GetLastBitrateDecreaseBps())
46 .WillOnce(Return(rtc::Optional<int>())) 46 .WillOnce(Return(rtc::Optional<int>()))
47 .WillOnce(Return(rtc::Optional<int>(5000))); 47 .WillOnce(Return(rtc::Optional<int>(5000)));
48 EXPECT_CALL(*states.aimd_rate_control, GetNearMaxIncreaseRateBps()) 48 EXPECT_CALL(*states.aimd_rate_control, GetNearMaxIncreaseRateBps())
49 .WillOnce(Return(4000)) 49 .WillOnce(Return(4000))
50 .WillOnce(Return(4000)); 50 .WillOnce(Return(4000));
51 51
52 EXPECT_EQ(rtc::Optional<int>(), 52 EXPECT_EQ(rtc::Optional<int64_t>(),
53 states.probing_interval_estimator->GetIntervalMs()); 53 states.probing_interval_estimator->GetIntervalMs());
54 EXPECT_NE(rtc::Optional<int>(), 54 EXPECT_NE(rtc::Optional<int64_t>(),
55 states.probing_interval_estimator->GetIntervalMs()); 55 states.probing_interval_estimator->GetIntervalMs());
56 } 56 }
57 57
58 TEST(ProbingIntervalEstimatorTest, CalcInterval) { 58 TEST(ProbingIntervalEstimatorTest, CalcInterval) {
59 auto states = CreateProbingIntervalEstimatorStates(); 59 auto states = CreateProbingIntervalEstimatorStates();
60 EXPECT_CALL(*states.aimd_rate_control, GetLastBitrateDecreaseBps()) 60 EXPECT_CALL(*states.aimd_rate_control, GetLastBitrateDecreaseBps())
61 .WillOnce(Return(rtc::Optional<int>(20000))); 61 .WillOnce(Return(rtc::Optional<int>(20000)));
62 EXPECT_CALL(*states.aimd_rate_control, GetNearMaxIncreaseRateBps()) 62 EXPECT_CALL(*states.aimd_rate_control, GetNearMaxIncreaseRateBps())
63 .WillOnce(Return(5000)); 63 .WillOnce(Return(5000));
64 EXPECT_EQ(rtc::Optional<int>(4000), 64 EXPECT_EQ(rtc::Optional<int64_t>(4000),
65 states.probing_interval_estimator->GetIntervalMs()); 65 states.probing_interval_estimator->GetIntervalMs());
66 } 66 }
67 67
68 TEST(ProbingIntervalEstimatorTest, IntervalDoesNotExceedMin) { 68 TEST(ProbingIntervalEstimatorTest, IntervalDoesNotExceedMin) {
69 auto states = CreateProbingIntervalEstimatorStates(); 69 auto states = CreateProbingIntervalEstimatorStates();
70 EXPECT_CALL(*states.aimd_rate_control, GetLastBitrateDecreaseBps()) 70 EXPECT_CALL(*states.aimd_rate_control, GetLastBitrateDecreaseBps())
71 .WillOnce(Return(rtc::Optional<int>(1000))); 71 .WillOnce(Return(rtc::Optional<int>(1000)));
72 EXPECT_CALL(*states.aimd_rate_control, GetNearMaxIncreaseRateBps()) 72 EXPECT_CALL(*states.aimd_rate_control, GetNearMaxIncreaseRateBps())
73 .WillOnce(Return(5000)); 73 .WillOnce(Return(5000));
74 EXPECT_EQ(rtc::Optional<int>(kMinIntervalMs), 74 EXPECT_EQ(rtc::Optional<int64_t>(kMinIntervalMs),
75 states.probing_interval_estimator->GetIntervalMs()); 75 states.probing_interval_estimator->GetIntervalMs());
76 } 76 }
77 77
78 TEST(ProbingIntervalEstimatorTest, IntervalDoesNotExceedMax) { 78 TEST(ProbingIntervalEstimatorTest, IntervalDoesNotExceedMax) {
79 auto states = CreateProbingIntervalEstimatorStates(); 79 auto states = CreateProbingIntervalEstimatorStates();
80 EXPECT_CALL(*states.aimd_rate_control, GetLastBitrateDecreaseBps()) 80 EXPECT_CALL(*states.aimd_rate_control, GetLastBitrateDecreaseBps())
81 .WillOnce(Return(rtc::Optional<int>(50000))); 81 .WillOnce(Return(rtc::Optional<int>(50000)));
82 EXPECT_CALL(*states.aimd_rate_control, GetNearMaxIncreaseRateBps()) 82 EXPECT_CALL(*states.aimd_rate_control, GetNearMaxIncreaseRateBps())
83 .WillOnce(Return(100)); 83 .WillOnce(Return(100));
84 EXPECT_EQ(rtc::Optional<int>(kMaxIntervalMs), 84 EXPECT_EQ(rtc::Optional<int64_t>(kMaxIntervalMs),
85 states.probing_interval_estimator->GetIntervalMs()); 85 states.probing_interval_estimator->GetIntervalMs());
86 } 86 }
87 } // namespace webrtc 87 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698