Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 IncomingFeedback(now_ms, send_time_ms, seq_num++, 1000, kPacingInfo1); | 112 IncomingFeedback(now_ms, send_time_ms, seq_num++, 1000, kPacingInfo1); |
| 113 } | 113 } |
| 114 | 114 |
| 115 EXPECT_TRUE(bitrate_observer_.updated()); | 115 EXPECT_TRUE(bitrate_observer_.updated()); |
| 116 EXPECT_NEAR(bitrate_observer_.latest_bitrate(), 4000000u, 10000u); | 116 EXPECT_NEAR(bitrate_observer_.latest_bitrate(), 4000000u, 10000u); |
| 117 } | 117 } |
| 118 | 118 |
| 119 TEST_F(DelayBasedBweTest, GetProbingInterval) { | 119 TEST_F(DelayBasedBweTest, GetProbingInterval) { |
| 120 int64_t default_interval_ms = bitrate_estimator_->GetProbingIntervalMs(); | 120 int64_t default_interval_ms = bitrate_estimator_->GetProbingIntervalMs(); |
| 121 EXPECT_GT(default_interval_ms, 0); | 121 EXPECT_GT(default_interval_ms, 0); |
| 122 CapacityDropTestHelper(1, true, 567, 0); | 122 CapacityDropTestHelper(1, true, 333, 0); |
|
terelius
2017/03/17 13:34:07
It would be nice to know why the send bitrate drop
stefan-webrtc
2017/03/30 07:26:48
I added some logging to see what happens:
109819
| |
| 123 int64_t interval_ms = bitrate_estimator_->GetProbingIntervalMs(); | 123 int64_t interval_ms = bitrate_estimator_->GetProbingIntervalMs(); |
| 124 EXPECT_GT(interval_ms, 0); | 124 EXPECT_GT(interval_ms, 0); |
| 125 EXPECT_NE(interval_ms, default_interval_ms); | 125 EXPECT_NE(interval_ms, default_interval_ms); |
| 126 } | 126 } |
| 127 | 127 |
| 128 TEST_F(DelayBasedBweTest, InitialBehavior) { | 128 TEST_F(DelayBasedBweTest, InitialBehavior) { |
| 129 InitialBehaviorTestHelper(674840); | 129 InitialBehaviorTestHelper(674840); |
| 130 } | 130 } |
| 131 | 131 |
| 132 TEST_F(DelayBasedBweTest, RateIncreaseReordering) { | 132 TEST_F(DelayBasedBweTest, RateIncreaseReordering) { |
| 133 RateIncreaseReorderingTestHelper(674840); | 133 RateIncreaseReorderingTestHelper(674840); |
| 134 } | 134 } |
| 135 | 135 |
| 136 TEST_F(DelayBasedBweTest, RateIncreaseRtpTimestamps) { | 136 TEST_F(DelayBasedBweTest, RateIncreaseRtpTimestamps) { |
| 137 RateIncreaseRtpTimestampsTestHelper(1240); | 137 RateIncreaseRtpTimestampsTestHelper(1288); |
| 138 } | 138 } |
| 139 | 139 |
| 140 TEST_F(DelayBasedBweTest, CapacityDropOneStream) { | 140 TEST_F(DelayBasedBweTest, CapacityDropOneStream) { |
| 141 CapacityDropTestHelper(1, false, 567, 0); | 141 CapacityDropTestHelper(1, false, 333, 0); |
| 142 } | 142 } |
| 143 | 143 |
| 144 TEST_F(DelayBasedBweTest, CapacityDropPosOffsetChange) { | 144 TEST_F(DelayBasedBweTest, CapacityDropPosOffsetChange) { |
| 145 CapacityDropTestHelper(1, false, 200, 30000); | 145 CapacityDropTestHelper(1, false, 300, 30000); |
| 146 } | 146 } |
| 147 | 147 |
| 148 TEST_F(DelayBasedBweTest, CapacityDropNegOffsetChange) { | 148 TEST_F(DelayBasedBweTest, CapacityDropNegOffsetChange) { |
| 149 CapacityDropTestHelper(1, false, 733, -30000); | 149 CapacityDropTestHelper(1, false, 300, -30000); |
| 150 } | 150 } |
| 151 | 151 |
| 152 TEST_F(DelayBasedBweTest, CapacityDropOneStreamWrap) { | 152 TEST_F(DelayBasedBweTest, CapacityDropOneStreamWrap) { |
| 153 CapacityDropTestHelper(1, true, 567, 0); | 153 CapacityDropTestHelper(1, true, 333, 0); |
| 154 } | 154 } |
| 155 | 155 |
| 156 TEST_F(DelayBasedBweTest, TestTimestampGrouping) { | 156 TEST_F(DelayBasedBweTest, TestTimestampGrouping) { |
| 157 TestTimestampGroupingTestHelper(); | 157 TestTimestampGroupingTestHelper(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 TEST_F(DelayBasedBweTest, TestShortTimeoutAndWrap) { | 160 TEST_F(DelayBasedBweTest, TestShortTimeoutAndWrap) { |
| 161 // Simulate a client leaving and rejoining the call after 35 seconds. This | 161 // Simulate a client leaving and rejoining the call after 35 seconds. This |
| 162 // will make abs send time wrap, so if streams aren't timed out properly | 162 // will make abs send time wrap, so if streams aren't timed out properly |
| 163 // the next 30 seconds of packets will be out of order. | 163 // the next 30 seconds of packets will be out of order. |
| 164 TestWrappingHelper(35); | 164 TestWrappingHelper(35); |
| 165 } | 165 } |
| 166 | 166 |
| 167 TEST_F(DelayBasedBweTest, TestLongTimeoutAndWrap) { | 167 TEST_F(DelayBasedBweTest, TestLongTimeoutAndWrap) { |
| 168 // Simulate a client leaving and rejoining the call after some multiple of | 168 // Simulate a client leaving and rejoining the call after some multiple of |
| 169 // 64 seconds later. This will cause a zero difference in abs send times due | 169 // 64 seconds later. This will cause a zero difference in abs send times due |
| 170 // to the wrap, but a big difference in arrival time, if streams aren't | 170 // to the wrap, but a big difference in arrival time, if streams aren't |
| 171 // properly timed out. | 171 // properly timed out. |
| 172 TestWrappingHelper(10 * 64); | 172 TestWrappingHelper(10 * 64); |
| 173 } | 173 } |
| 174 | 174 |
| 175 class DelayBasedBweExperimentTest : public DelayBasedBweTest { | 175 class DelayBasedBweExperimentTest : public DelayBasedBweTest { |
|
terelius
2017/03/17 13:34:08
Could we remove this class?
There is also a refer
stefan-webrtc
2017/03/30 07:26:48
Done.
| |
| 176 public: | 176 public: |
| 177 DelayBasedBweExperimentTest() | 177 DelayBasedBweExperimentTest() |
| 178 : override_field_trials_("WebRTC-ImprovedBitrateEstimate/Enabled/") { | 178 : override_field_trials_("WebRTC-ImprovedBitrateEstimate/Enabled/") { |
| 179 bitrate_estimator_.reset(new DelayBasedBwe(nullptr, &clock_)); | 179 bitrate_estimator_.reset(new DelayBasedBwe(nullptr, &clock_)); |
| 180 } | 180 } |
| 181 | 181 |
| 182 private: | 182 private: |
| 183 test::ScopedFieldTrials override_field_trials_; | 183 test::ScopedFieldTrials override_field_trials_; |
| 184 }; | 184 }; |
| 185 | 185 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 208 DelayBasedBweTrendlineExperimentTest() | 208 DelayBasedBweTrendlineExperimentTest() |
| 209 : override_field_trials_("WebRTC-BweTrendlineFilter/Enabled-15,0.9,4/") { | 209 : override_field_trials_("WebRTC-BweTrendlineFilter/Enabled-15,0.9,4/") { |
| 210 bitrate_estimator_.reset(new DelayBasedBwe(nullptr, &clock_)); | 210 bitrate_estimator_.reset(new DelayBasedBwe(nullptr, &clock_)); |
| 211 } | 211 } |
| 212 | 212 |
| 213 private: | 213 private: |
| 214 test::ScopedFieldTrials override_field_trials_; | 214 test::ScopedFieldTrials override_field_trials_; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 TEST_F(DelayBasedBweTrendlineExperimentTest, RateIncreaseRtpTimestamps) { | 217 TEST_F(DelayBasedBweTrendlineExperimentTest, RateIncreaseRtpTimestamps) { |
| 218 RateIncreaseRtpTimestampsTestHelper(1240); | 218 RateIncreaseRtpTimestampsTestHelper(1288); |
| 219 } | 219 } |
| 220 | 220 |
| 221 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropOneStream) { | 221 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropOneStream) { |
| 222 CapacityDropTestHelper(1, false, 600, 0); | 222 CapacityDropTestHelper(1, false, 433, 0); |
| 223 } | 223 } |
| 224 | 224 |
| 225 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropPosOffsetChange) { | 225 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropPosOffsetChange) { |
| 226 CapacityDropTestHelper(1, false, 600, 30000); | 226 CapacityDropTestHelper(1, false, 600, 30000); |
| 227 } | 227 } |
| 228 | 228 |
| 229 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropNegOffsetChange) { | 229 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropNegOffsetChange) { |
| 230 CapacityDropTestHelper(1, false, 1267, -30000); | 230 CapacityDropTestHelper(1, false, 767, -30000); |
| 231 } | 231 } |
| 232 | 232 |
| 233 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropOneStreamWrap) { | 233 TEST_F(DelayBasedBweTrendlineExperimentTest, CapacityDropOneStreamWrap) { |
| 234 CapacityDropTestHelper(1, true, 600, 0); | 234 CapacityDropTestHelper(1, true, 433, 0); |
| 235 } | 235 } |
| 236 | 236 |
| 237 class DelayBasedBweMedianSlopeExperimentTest : public DelayBasedBweTest { | 237 class DelayBasedBweMedianSlopeExperimentTest : public DelayBasedBweTest { |
| 238 public: | 238 public: |
| 239 DelayBasedBweMedianSlopeExperimentTest() | 239 DelayBasedBweMedianSlopeExperimentTest() |
| 240 : override_field_trials_("WebRTC-BweMedianSlopeFilter/Enabled-20,4/") { | 240 : override_field_trials_("WebRTC-BweMedianSlopeFilter/Enabled-20,4/") { |
| 241 bitrate_estimator_.reset(new DelayBasedBwe(nullptr, &clock_)); | 241 bitrate_estimator_.reset(new DelayBasedBwe(nullptr, &clock_)); |
| 242 } | 242 } |
| 243 | 243 |
| 244 private: | 244 private: |
| 245 test::ScopedFieldTrials override_field_trials_; | 245 test::ScopedFieldTrials override_field_trials_; |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 TEST_F(DelayBasedBweMedianSlopeExperimentTest, RateIncreaseRtpTimestamps) { | 248 TEST_F(DelayBasedBweMedianSlopeExperimentTest, RateIncreaseRtpTimestamps) { |
| 249 RateIncreaseRtpTimestampsTestHelper(1240); | 249 RateIncreaseRtpTimestampsTestHelper(1288); |
| 250 } | 250 } |
| 251 | 251 |
| 252 TEST_F(DelayBasedBweMedianSlopeExperimentTest, CapacityDropOneStream) { | 252 TEST_F(DelayBasedBweMedianSlopeExperimentTest, CapacityDropOneStream) { |
| 253 CapacityDropTestHelper(1, false, 600, 0); | 253 CapacityDropTestHelper(1, false, 367, 0); |
| 254 } | 254 } |
| 255 | 255 |
| 256 TEST_F(DelayBasedBweMedianSlopeExperimentTest, CapacityDropPosOffsetChange) { | 256 TEST_F(DelayBasedBweMedianSlopeExperimentTest, CapacityDropPosOffsetChange) { |
| 257 CapacityDropTestHelper(1, false, 600, 30000); | 257 CapacityDropTestHelper(1, false, 600, 30000); |
| 258 } | 258 } |
| 259 | 259 |
| 260 TEST_F(DelayBasedBweMedianSlopeExperimentTest, CapacityDropNegOffsetChange) { | 260 TEST_F(DelayBasedBweMedianSlopeExperimentTest, CapacityDropNegOffsetChange) { |
| 261 CapacityDropTestHelper(1, false, 1267, -30000); | 261 CapacityDropTestHelper(1, false, 767, -30000); |
| 262 } | 262 } |
| 263 | 263 |
| 264 TEST_F(DelayBasedBweMedianSlopeExperimentTest, CapacityDropOneStreamWrap) { | 264 TEST_F(DelayBasedBweMedianSlopeExperimentTest, CapacityDropOneStreamWrap) { |
| 265 CapacityDropTestHelper(1, true, 600, 0); | 265 CapacityDropTestHelper(1, true, 367, 0); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace webrtc | 268 } // namespace webrtc |
| OLD | NEW |