commit | 9ea464c7fee0e7ea85e0702c70dea52c332eb337 | [log] [tgz] |
---|---|---|
author | Pavol Marko <pmarko@chromium.org> | Fri Mar 08 09:54:15 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Mar 08 09:54:15 2019 |
tree | 33fd4ff3ced56427f4b6d04d978a36c3f67dd24e | |
parent | 7e550e979bfe5918dc232bee3ab3401dcd1a6496 [diff] |
Isolate download dirs in download related unit tests The tests in question were using ScopedPathOverride to set the download directory root, which changes process-global state (in PathService). When unit tests were running in parallel, they were flaky because they all accessed and modified this process-global state which has been cached in DownloadPrefs. The ChromeDownloadManagerDelegateTest was using DownloadPrefs::ReinitializeDefaultDownloadDirectoryForTesting to work around the caching issue, but this effectively only reduces the race window. Instead, use DownloadPrefs to expclitly give each test case its own download directory root. It was necessary to skip download directory sanitization for this so the test can freely choose the directory. Bug: 899918 Test: unit_tests --gtest_filter=*ChromeDownloadManagerDelegateTest* Test: unit_tests --gtest_filter=*DownloadTargetDeterminerTest* Change-Id: I1019d1db86cfc297bb8a834ee88c6bf7cd81016f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505445 Reviewed-by: Min Qin <qinmin@chromium.org> Commit-Queue: Pavol Marko <pmarko@chromium.org> Cr-Commit-Position: refs/heads/master@{#638960}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .