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

Side by Side Diff: webrtc/video/video_send_stream_tests.cc

Issue 2685503002: Fix for flaky RemoveOverheadFromBandwidth test. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #include <algorithm> // max 10 #include <algorithm> // max
(...skipping 3138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3149 TEST_F(VideoSendStreamTest, 3149 TEST_F(VideoSendStreamTest,
3150 RequestSourceRotateIfVideoOrientationExtensionNotSupported) { 3150 RequestSourceRotateIfVideoOrientationExtensionNotSupported) {
3151 TestRequestSourceRotateVideo(false); 3151 TestRequestSourceRotateVideo(false);
3152 } 3152 }
3153 3153
3154 TEST_F(VideoSendStreamTest, 3154 TEST_F(VideoSendStreamTest,
3155 DoNotRequestsRotationIfVideoOrientationExtensionSupported) { 3155 DoNotRequestsRotationIfVideoOrientationExtensionSupported) {
3156 TestRequestSourceRotateVideo(true); 3156 TestRequestSourceRotateVideo(true);
3157 } 3157 }
3158 3158
3159 // Flaky on Win http://crbug.com/webrtc/6886
3160 #if defined(WEBRTC_WIN)
3161 #define MAYBE_RemoveOverheadFromBandwidth DISABLED_RemoveOverheadFromBandwidth
3162 #else
3163 #define MAYBE_RemoveOverheadFromBandwidth RemoveOverheadFromBandwidth
3164 #endif
3165
3166 // This test verifies that overhead is removed from the bandwidth estimate by 3159 // This test verifies that overhead is removed from the bandwidth estimate by
3167 // testing that the maximum possible target payload rate is smaller than the 3160 // testing that the maximum possible target payload rate is smaller than the
3168 // maximum bandwidth estimate by the overhead rate. 3161 // maximum bandwidth estimate by the overhead rate.
3169 TEST_F(VideoSendStreamTest, MAYBE_RemoveOverheadFromBandwidth) { 3162 TEST_F(VideoSendStreamTest, RemoveOverheadFromBandwidth) {
3170 test::ScopedFieldTrials override_field_trials( 3163 test::ScopedFieldTrials override_field_trials(
3171 "WebRTC-SendSideBwe-WithOverhead/Enabled/"); 3164 "WebRTC-SendSideBwe-WithOverhead/Enabled/");
3172 class RemoveOverheadFromBandwidthTest : public test::EndToEndTest, 3165 class RemoveOverheadFromBandwidthTest : public test::EndToEndTest,
3173 public test::FakeEncoder { 3166 public test::FakeEncoder {
3174 public: 3167 public:
3175 RemoveOverheadFromBandwidthTest() 3168 RemoveOverheadFromBandwidthTest()
3176 : EndToEndTest(test::CallTest::kDefaultTimeoutMs), 3169 : EndToEndTest(test::CallTest::kDefaultTimeoutMs),
3177 FakeEncoder(Clock::GetRealTimeClock()), 3170 FakeEncoder(Clock::GetRealTimeClock()),
3178 call_(nullptr), 3171 call_(nullptr),
3179 max_bitrate_bps_(0), 3172 max_bitrate_bps_(0),
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
3213 3206
3214 void PerformTest() override { 3207 void PerformTest() override {
3215 Call::Config::BitrateConfig bitrate_config; 3208 Call::Config::BitrateConfig bitrate_config;
3216 constexpr int kStartBitrateBps = 60000; 3209 constexpr int kStartBitrateBps = 60000;
3217 constexpr int kMaxBitrateBps = 60000; 3210 constexpr int kMaxBitrateBps = 60000;
3218 constexpr int kMinBitrateBps = 10000; 3211 constexpr int kMinBitrateBps = 10000;
3219 bitrate_config.start_bitrate_bps = kStartBitrateBps; 3212 bitrate_config.start_bitrate_bps = kStartBitrateBps;
3220 bitrate_config.max_bitrate_bps = kMaxBitrateBps; 3213 bitrate_config.max_bitrate_bps = kMaxBitrateBps;
3221 bitrate_config.min_bitrate_bps = kMinBitrateBps; 3214 bitrate_config.min_bitrate_bps = kMinBitrateBps;
3222 call_->SetBitrateConfig(bitrate_config); 3215 call_->SetBitrateConfig(bitrate_config);
3223 call_->OnTransportOverheadChanged(webrtc::MediaType::VIDEO, 20); 3216 call_->OnTransportOverheadChanged(webrtc::MediaType::VIDEO, 40);
3224 3217
3225 // At a bitrate of 60kbps with a packet size of 1200B video and an 3218 // At a bitrate of 60kbps with a packet size of 1200B video and an
3226 // overhead of 40B per packet video produces 2240bps overhead. 3219 // overhead of 40B per packet video produces 2240bps overhead.
3227 // So the encoder BW should be set to 57760bps. 3220 // So the encoder BW should be set to 57760bps.
3228 bitrate_changed_event_.Wait(VideoSendStreamTest::kDefaultTimeoutMs); 3221 bitrate_changed_event_.Wait(VideoSendStreamTest::kDefaultTimeoutMs);
3229 { 3222 {
3230 rtc::CritScope lock(&crit_); 3223 rtc::CritScope lock(&crit_);
3231 EXPECT_LE(57760u, max_bitrate_bps_); 3224 EXPECT_LE(max_bitrate_bps_, 57760u);
minyue-webrtc 2017/02/07 13:04:00 alternatively, we can change this to 57780u right?
minyue-webrtc 2017/02/07 13:04:00 GE?
minyue-webrtc 2017/02/07 13:08:50 forget this comment. I see the point. We used a w
3232 } 3225 }
3233 } 3226 }
3234 3227
3235 private: 3228 private:
3236 Call* call_; 3229 Call* call_;
3237 rtc::CriticalSection crit_; 3230 rtc::CriticalSection crit_;
3238 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); 3231 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_);
3239 bool first_packet_sent_ GUARDED_BY(&crit_); 3232 bool first_packet_sent_ GUARDED_BY(&crit_);
3240 rtc::Event bitrate_changed_event_; 3233 rtc::Event bitrate_changed_event_;
3241 } test; 3234 } test;
3242 3235
3243 RunBaseTest(&test); 3236 RunBaseTest(&test);
3244 } 3237 }
3245 3238
3246 } // namespace webrtc 3239 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698