Fix race condition for GetContributingSources test.

Bug: webrtc:9813
Change-Id: I44f50f9858217c8303862f3820db11dbd8736b6c
Reviewed-on: https://webrtc-review.googlesource.com/c/104121
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Yves Gerey <yvesg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25042}
This commit is contained in:
Yves Gerey 2018-10-08 10:08:32 +02:00 committed by Commit Bot
parent 666fb32d1f
commit b6a8942fb4

View File

@ -6905,16 +6905,20 @@ TEST_F(WebRtcVideoChannelSimulcastTest,
false);
}
// The fake clock needs to be initialize before the call.
// So defer creating call in base class.
class WebRtcVideoChannelTestWithClock : public WebRtcVideoChannelBaseTest {
class WebRtcVideoFakeClock {
public:
WebRtcVideoChannelTestWithClock() {
WebRtcVideoFakeClock() {
fake_clock_.AdvanceTime(webrtc::TimeDelta::ms(1)); // avoid time=0
}
rtc::ScopedFakeClock fake_clock_;
};
// The fake clock needs to be initialized before the call, and not
// destroyed until after all threads spawned by the test have been stopped.
// This mixin ensures that.
class WebRtcVideoChannelTestWithClock : public WebRtcVideoFakeClock,
public WebRtcVideoChannelBaseTest {};
TEST_F(WebRtcVideoChannelTestWithClock, GetSources) {
uint8_t data1[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};