Add a multi-process time zone scoper for testing. The base::test::ScopedRestoreDefaultTimezone class works fine for single-process tests, and for multi-process tests on Linux. On Linux, where zygotes are normally enabled, zygotes will pass the browser time zone to newly spawned processes, but this is an implementation detail. To make scoped time zone changes work across platform, add a new content::ScopedTimeZone class that: 1) Wraps base::test::ScopedRestoreDefaultTimezone. 2) Changes the command line within its scope to have --time-zone-for-testing=new_zoneid. Then change child processes to read the value of this command line switch and apply it. Use it in pdf_extension_test.cc to make a test case more reliably pass independent of the host machine's time zone. Note that the scoper only affects the running process and any child processes it creates. Other existing processes are not affected. Bug: 1199021 Change-Id: I18f82007598e37a873126cb0716c8321d159ef8f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2795988 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Cr-Commit-Position: refs/heads/master@{#872683}
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.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.