commit | 63860ed142dd894a7f4de765c015389340f57374 | [log] [tgz] |
---|---|---|
author | Benoît Lizé <lizeb@chromium.org> | Tue Apr 23 09:34:27 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Apr 23 09:34:27 2019 |
tree | 4d455de02a74dbef05adbfb12b595c4f9b707a97 | |
parent | 6560bcb5fd490a5bb689e61ca64a12d1fd8ce0b5 [diff] |
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;