Call Call::GetStats() from the correct thread in StatsEndToEndTest.

Bug: webrtc:10847
Change-Id: I8a82709073827f0eb901e20600f4e8bcf86d96a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/148061
Reviewed-by: Magnus Flodman <mflodman@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28786}
This commit is contained in:
Tommi 2019-08-05 15:01:48 +02:00 committed by Commit Bot
parent c24a5b18ba
commit d23f67e6be

View file

@ -749,7 +749,9 @@ TEST_F(StatsEndToEndTest, CallReportsRttForSender) {
int64_t start_time_ms = clock_->TimeInMilliseconds(); int64_t start_time_ms = clock_->TimeInMilliseconds();
while (true) { while (true) {
Call::Stats stats = sender_call_->GetStats(); Call::Stats stats;
task_queue_.SendTask(
[this, &stats]() { stats = sender_call_->GetStats(); });
ASSERT_GE(start_time_ms + kDefaultTimeoutMs, clock_->TimeInMilliseconds()) ASSERT_GE(start_time_ms + kDefaultTimeoutMs, clock_->TimeInMilliseconds())
<< "No RTT stats before timeout!"; << "No RTT stats before timeout!";
if (stats.rtt_ms != -1) { if (stats.rtt_ms != -1) {