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

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

Issue 2990163002: Almost full implementation of BBR's core. (Closed)
Patch Set: Created 3 years, 4 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
11 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter .h" 11 #include "webrtc/modules/remote_bitrate_estimator/test/estimators/min_rtt_filter .h"
12 12
13 #include "webrtc/test/gtest.h" 13 #include "webrtc/test/gtest.h"
14 14
15 namespace webrtc { 15 namespace webrtc {
16 namespace testing { 16 namespace testing {
17 namespace bwe { 17 namespace bwe {
18 TEST(MinRttFilterTest, InitializationCheck) { 18 TEST(MinRttFilterTest, InitializationCheck) {
19 MinRttFilter min_rtt_filter; 19 MinRttFilter min_rtt_filter;
20 EXPECT_FALSE(min_rtt_filter.min_rtt_ms()); 20 EXPECT_FALSE(min_rtt_filter.min_rtt_ms());
21 EXPECT_EQ(min_rtt_filter.discovery_time(), 0); 21 EXPECT_EQ(min_rtt_filter.discovery_time(), 0);
22 } 22 }
23 23
24 TEST(MinRttFilterTest, AddRttSample) { 24 TEST(MinRttFilterTest, AddRttSample) {
25 MinRttFilter min_rtt_filter; 25 MinRttFilter min_rtt_filter;
26 min_rtt_filter.add_rtt_sample(120, 5); 26 min_rtt_filter.add_rtt_sample(120, 5, false);
27 EXPECT_EQ(min_rtt_filter.min_rtt_ms(), 120); 27 EXPECT_EQ(min_rtt_filter.min_rtt_ms(), 120);
28 EXPECT_EQ(min_rtt_filter.discovery_time(), 5); 28 EXPECT_EQ(min_rtt_filter.discovery_time(), 5);
29 min_rtt_filter.add_rtt_sample(121, 6); 29 min_rtt_filter.add_rtt_sample(121, 6, false);
30 EXPECT_EQ(min_rtt_filter.discovery_time(), 5); 30 EXPECT_EQ(min_rtt_filter.discovery_time(), 5);
31 min_rtt_filter.add_rtt_sample(119, 7); 31 min_rtt_filter.add_rtt_sample(119, 7, false);
32 EXPECT_EQ(min_rtt_filter.discovery_time(), 7); 32 EXPECT_EQ(min_rtt_filter.discovery_time(), 7);
33 min_rtt_filter.add_rtt_sample(140, 17, true);
34 EXPECT_EQ(min_rtt_filter.discovery_time(), 17);
35 EXPECT_EQ(min_rtt_filter.min_rtt_ms(), 140);
33 } 36 }
34 37
35 TEST(MinRttFilterTest, MinRttExpired) { 38 TEST(MinRttFilterTest, MinRttExpired) {
36 MinRttFilter min_rtt_filter; 39 MinRttFilter min_rtt_filter;
37 min_rtt_filter.add_rtt_sample(120, 5); 40 min_rtt_filter.add_rtt_sample(120, 5, false);
38 EXPECT_EQ(min_rtt_filter.min_rtt_expired(10, 5), true); 41 EXPECT_EQ(min_rtt_filter.min_rtt_expired(10, 5), true);
39 EXPECT_EQ(min_rtt_filter.min_rtt_expired(9, 5), false); 42 EXPECT_EQ(min_rtt_filter.min_rtt_expired(9, 5), false);
40 } 43 }
41 } // namespace bwe 44 } // namespace bwe
42 } // namespace testing 45 } // namespace testing
43 } // namespace webrtc 46 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698