Deflake PluginMetricsProviderTest.RecordCurrentStateWithDelay.

This test is flaky on platforms that where Sleep(delta) isn't
guaranteed to be in TimeTicks (e.g. on Mac, it's in base::Time).
Use base::test::ScopedTaskEnvironment::MainThreadType::MOCK_TIME
instead.

Also, cleans up some APIs and adds a comment to the Sleep() API.

Bug: 915672
Change-Id: Ib539c0d06a217dfdb9ee6f7411e885d6975438a9
Reviewed-on: https://chromium-review.googlesource.com/c/1427927
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625387}
4 files changed