| Index: webrtc/modules/pacing/alr_detector_unittest.cc
|
| diff --git a/webrtc/modules/pacing/alr_detector_unittest.cc b/webrtc/modules/pacing/alr_detector_unittest.cc
|
| index a30f9fa86329b5cf0957ef40274bd40c31cd198c..e422fed5e2143566ed851a4600439153102950b7 100644
|
| --- a/webrtc/modules/pacing/alr_detector_unittest.cc
|
| +++ b/webrtc/modules/pacing/alr_detector_unittest.cc
|
| @@ -24,25 +24,30 @@ namespace webrtc {
|
|
|
| TEST(AlrDetectorTest, ApplicationLimitedWhenLittleDataSent) {
|
| AlrDetector alr_detector;
|
| -
|
| + int now_ms = 0;
|
| alr_detector.SetEstimatedBitrate(kEstimatedBitrateBps);
|
| - for (int i = 0; i < 6; i++)
|
| - alr_detector.OnBytesSent(0, kMeasuredIntervalMs);
|
| - EXPECT_EQ(alr_detector.InApplicationLimitedRegion(), true);
|
| -
|
| - for (int i = 0; i < 6; i++)
|
| - alr_detector.OnBytesSent(100, kMeasuredIntervalMs);
|
| - EXPECT_EQ(alr_detector.InApplicationLimitedRegion(), true);
|
| + for (int i = 0; i < 6; i++) {
|
| + now_ms += kMeasuredIntervalMs;
|
| + alr_detector.OnBytesSent(0, now_ms);
|
| + }
|
| + EXPECT_TRUE(alr_detector.InApplicationLimitedRegion());
|
| +
|
| + for (int i = 0; i < 6; i++) {
|
| + now_ms += kMeasuredIntervalMs;
|
| + alr_detector.OnBytesSent(100, now_ms);
|
| + }
|
| + EXPECT_TRUE(alr_detector.InApplicationLimitedRegion());
|
| }
|
|
|
| TEST(AlrDetectorTest, NetworkLimitedWhenSendingCloseToEstimate) {
|
| AlrDetector alr_detector;
|
| -
|
| + int64_t now_ms = 0;
|
| alr_detector.SetEstimatedBitrate(kEstimatedBitrateBps);
|
| - for (int i = 0; i < 6; i++)
|
| - alr_detector.OnBytesSent(kBytesInIntervalAtEstimatedBitrate,
|
| - kMeasuredIntervalMs);
|
| - EXPECT_EQ(alr_detector.InApplicationLimitedRegion(), false);
|
| + for (int i = 0; i < 6; i++) {
|
| + now_ms += kMeasuredIntervalMs;
|
| + alr_detector.OnBytesSent(kBytesInIntervalAtEstimatedBitrate, now_ms);
|
| + }
|
| + EXPECT_FALSE(alr_detector.InApplicationLimitedRegion());
|
| }
|
|
|
| } // namespace webrtc
|
|
|