Do not perform font scanning when cache directory not configured
Fixes flakiness in unit testing due to DWriteFontLookupTableBuilder spuriously trying to index fonts when it should not. In order to test DWriteFontLookupTableBuilder a cache directory is configured for persisting the built table. The same happens when a full browser runs with a profile - in which case a subdirectory of the USER_DATA directory is used. Do not scan fonts if a directory is not configured. This situation happens in unit tests in tests other than the DWriteFontLookupTableBuilder unit tests, as ContentClient and BrowserClient do not return a path for GetFontLookupTableCacheDir() in testing. It is sufficient to test DWriteFontLookupTableBuilder in its own unittests. If local unique font matching on Windows 7 is required in a unit test, a cache directory can be configured using DWriteFontLookupTableBuilder::GetInstance()-> SetCacheDirectoryForTesting(...) Thanks to etienneb@ for spotting this problem and initial fix proposals. Bug: 996167 Change-Id: Iccac27225d7be7fc464a645e7e7689eba3680efa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769437Reviewed-by:Etienne Bergeron <etienneb@chromium.org> Commit-Queue: Dominik Röttsches <drott@chromium.org> Auto-Submit: Dominik Röttsches <drott@chromium.org> Cr-Commit-Position: refs/heads/master@{#691074}
Showing
Please register or sign in to comment