Commit 3a161f13 authored by Eric Seckler's avatar Eric Seckler Committed by Commit Bot

chrome metrics: Refactor ThreadWatcherTest for TestBrowserThreadBundle

This makes ThreadWatcherTest compatible for use of
TestBrowserThreadBundle to prepare for the upcoming PostTask refactor.

The TestBrowserThreadBundle initializes globals that will be required to
post a task to or obtain a TaskRunner for a BrowserThread.

This is a more involved change, since ThreadWatcherTest currently runs
the UI thread on a separate thread from the main thread. Since this is
not supported by TBTB, this change also refactors the test architecture.

The tests now use the WatchDogThread to verify expectations and wait
for state changes on the ThreadWatcher objects. This is closer to the
way ThreadWatcher would be used in practice.

State changes are now observed on the WatchDogThread, too, eliminaing
the need for some locking, and signalling uses nested RunLoops instead
of condition variables where possible.

Bug: 878356
Change-Id: I6e759b140c7544b7abbdb8fd59f6a51163dc31e4
Reviewed-on: https://chromium-review.googlesource.com/1222891Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591317}
parent 7dc412de
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