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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/congestion_window_unittest.cc

Issue 2966403002: Added implementation of three classes in BBR,with unit-tests. (Closed)
Patch Set: Added logic for entering/exiting modes in BBR, added new bandwidth filter. Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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 28 matching lines...) Expand all
39 congestion_window.PacketSent(10); 39 congestion_window.PacketSent(10);
40 congestion_window.PacketSent(9); 40 congestion_window.PacketSent(9);
41 EXPECT_EQ(congestion_window.data_inflight(), 20u); 41 EXPECT_EQ(congestion_window.data_inflight(), 20u);
42 congestion_window.AckReceived(20); 42 congestion_window.AckReceived(20);
43 EXPECT_EQ(congestion_window.data_inflight(), 0u); 43 EXPECT_EQ(congestion_window.data_inflight(), 0u);
44 } 44 }
45 45
46 TEST(CongestionWindowTest, ZeroBandwidthDelayProduct) { 46 TEST(CongestionWindowTest, ZeroBandwidthDelayProduct) {
47 CongestionWindow congestion_window; 47 CongestionWindow congestion_window;
48 int64_t target_congestion_window = 48 int64_t target_congestion_window =
49 congestion_window.GetTargetCongestionWindow(100, 0, 2.885f); 49 congestion_window.GetTargetCongestionWindow(
50 100, rtc::Optional<int64_t>(0), 2.885f);
50 EXPECT_EQ(target_congestion_window, 2.885f * kStartingCongestionWindow); 51 EXPECT_EQ(target_congestion_window, 2.885f * kStartingCongestionWindow);
51 } 52 }
52 53
53 TEST(CongestionWindowTest, BelowMinimumTargetCongestionWindow) { 54 TEST(CongestionWindowTest, BelowMinimumTargetCongestionWindow) {
54 CongestionWindow congestion_window; 55 CongestionWindow congestion_window;
55 int64_t target_congestion_window = 56 int64_t target_congestion_window =
56 congestion_window.GetTargetCongestionWindow(100, 2, 2.885f); 57 congestion_window.GetTargetCongestionWindow(
58 100, rtc::Optional<int64_t>(2), 2.885f);
57 EXPECT_EQ(target_congestion_window, kMinimumCongestionWindow); 59 EXPECT_EQ(target_congestion_window, kMinimumCongestionWindow);
58 } 60 }
59 61
60 TEST(CongestionWindowTest, AboveMinimumTargetCongestionWindow) { 62 TEST(CongestionWindowTest, AboveMinimumTargetCongestionWindow) {
61 CongestionWindow congestion_window; 63 CongestionWindow congestion_window;
62 int64_t target_congestion_window = 64 int64_t target_congestion_window =
63 congestion_window.GetTargetCongestionWindow(100000, 2, 2.885f); 65 congestion_window.GetTargetCongestionWindow(
66 100000, rtc::Optional<int64_t>(2), 2.885f);
64 EXPECT_EQ(target_congestion_window, 577000); 67 EXPECT_EQ(target_congestion_window, 577000);
65 } 68 }
66 69
67 TEST(CongestionWindowTest, MinimumCongestionWindow) { 70 TEST(CongestionWindowTest, MinimumCongestionWindow) {
68 CongestionWindow congestion_window; 71 CongestionWindow congestion_window;
69 int64_t cwnd = congestion_window.GetCongestionWindow(BbrBweSender::PROBE_RTT, 72 int64_t cwnd = congestion_window.GetCongestionWindow(
70 100, 100, 2.885f); 73 BbrBweSender::PROBE_RTT, 100, rtc::Optional<int64_t>(100), 2.885f);
71 EXPECT_EQ(cwnd, kMinimumCongestionWindow); 74 EXPECT_EQ(cwnd, kMinimumCongestionWindow);
72 } 75 }
73 76
74 TEST(CongestionWindowTest, CalculateCongestionWindow) { 77 TEST(CongestionWindowTest, CalculateCongestionWindow) {
75 CongestionWindow congestion_window; 78 CongestionWindow congestion_window;
76 int64_t cwnd = congestion_window.GetCongestionWindow(BbrBweSender::STARTUP, 79 int64_t cwnd = congestion_window.GetCongestionWindow(
77 100, 100, 2.885f); 80 BbrBweSender::STARTUP, 100, rtc::Optional<int64_t>(100l), 2.885f);
78 EXPECT_EQ(cwnd, 28850); 81 EXPECT_EQ(cwnd, 28850);
79 } 82 }
80 } // namespace bwe 83 } // namespace bwe
81 } // namespace testing 84 } // namespace testing
82 } // namespace webrtc 85 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698