0
Files
src/content/utility
Lei Zhang 8e6e2d5f64 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}
2021-04-15 03:08:11 +00:00
..
2021-04-09 18:46:20 +00:00
2021-04-09 18:46:20 +00:00