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:Ilya Sherman <isherman@chromium.org> Commit-Queue: Eric Seckler <eseckler@chromium.org> Cr-Commit-Position: refs/heads/master@{#591317}
Showing
This diff is collapsed.
Please register or sign in to comment