The test starts a local Apprtc server, then connects to the same room from two tabs.
When the second tab is opened too soon, it can happen that the first tab never gets to request video capture to start, probably because its execution is suspended while it is not in the foreground.
This issue was first detected by the test failing (timing out) after enabling the video capture service in CL https://chromium-review.googlesource.com/c/524298/. This CL triggered the race condition on certain bots, because it adds a few milliseconds of process startup delay to the first video capture request.
The issue easily reproduces without enabling the video capture service by adding a small delay to the in-process video capture stack, for example by changing the PostTask at [1] to a PostDelayedTask.
[1] https://cs.chromium.org/chromium/src/content/browser/renderer_host/media/in_process_video_capture_provider.cc?dr=CSs&l=55
Comment 1 by bugdroid1@chromium.org
, Jun 27 2017