Commit 20420163 authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Fix race condition in WebRtcInternalsBrowserTest.

SetUpOnMainThread is too late to mutate the command-line. By then, other
threads have started and may be reading from it. Instead, use
SetUpCommandLine.

This should fix the following TSan flake:
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8917832371169415328/+/steps/content_browsertests/0/logs/Flaky_failure:_WebRtcInternalsBrowserTest.UpdateAllPeerConnections__status_FAILURE_ON_EXIT_SUCCESS_/0

Change-Id: Ibf819a3247b290b9d583d25dc0111881868c4a74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1541497
Auto-Submit: David Benjamin <davidben@chromium.org>
Reviewed-by: default avatarAlexander Potapenko <glider@chromium.org>
Reviewed-by: default avatarChristian Fremerey <chfremer@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646407}
parent 0b803ed4
......@@ -155,9 +155,11 @@ class MAYBE_WebRtcInternalsBrowserTest: public ContentBrowserTest {
MAYBE_WebRtcInternalsBrowserTest() {}
~MAYBE_WebRtcInternalsBrowserTest() override {}
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(switches::kUseFakeUIForMediaStream);
}
void SetUpOnMainThread() override {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kUseFakeUIForMediaStream);
ASSERT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseFakeDeviceForMediaStream));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment