Move more Omaha tests to become Robolectric tests This change moves the ExponentialBackoffSchedulerTest, RequestGeneratorTest, and OmahaBaseTest to be based on Robolectric. Multiple files depended on MockExponentialBackoffScheduler, MockRequestGenerator, and AttributeFinder, so instead of doing gymnastics with temporary putting these in a shared GN test support target, these test fixes are submitted together. Using Robolectric requires stopping all usage of AdvancedMockContext, though InMemorySharedPreferencesContext is OK. However, Robolectric provides similar functionality as AdvancedMockContext through RuntimeEnvironment.getApplication(). The OmahaBaseTest directly invokes checking for updates, which should not be invoked on the main thread. However, in this very targeted test it is OK to do so, but the thread asserts still fail. This change therefore changes to do the assert through TestUtil, and creates an AutoCloseable to ensure as little test code as possible is affected by disabling thread asserts. R=waffles@chromium.org Bug: 1332190, 1332191, 1332192 Change-Id: I6687ec2bff7180ba3a4566ebe9b8a78f34f11ada Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3705785 Reviewed-by: Joshua Pawlicki <waffles@chromium.org> Commit-Queue: Tommy Nyquist <nyquist@chromium.org> Cr-Commit-Position: refs/heads/main@{#1014921}
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.
If you found a bug, please file it at https://crbug.com/new.