blink/bindings: Wait for ThreadTicks initialization in tests.

This is the likely cause for this revert:
https://chromium-review.googlesource.com/c/chromium/src/+/1574286

If true, then the culprit CL only triggered the issue by accident.

Bug: 924164
Change-Id: I8261f20e91fbcdf7284b17630bad25f19176ff60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1577423
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653114}
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string_test.cc b/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
index a79ea53..5594821 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
+++ b/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
@@ -968,6 +968,12 @@
 TEST_F(ParkableStringForegroundParkingTest, ReportTotalUnparkingTime) {
   base::HistogramTester histogram_tester;
 
+  // On some platforms, initialization takes time, though it happens when
+  // base::ThreadTicks is used. To prevent flakiness depending on test execution
+  // ordering, force initialization.
+  if (base::ThreadTicks::IsSupported())
+    base::ThreadTicks::WaitUntilInitialized();
+
   // Need to make the string really large, otherwise unparking takes less than
   // 1ms, and the 0 bucket is populated.
   const size_t original_size = 5 * 1000 * 1000;