Create a TestRule for dagger module overrides

If modules are overriden in @Before, dagger components may get created
before the modules are overriden. This can lead to hard-to-debug test
failures due to seemingly unrelated to changes in code.

In this CL I add ModuleOverridesRule. It can be chained with other rules
to make sure it's executed before them.

Change-Id: I2952f56f2f4b1c852805e07e19774033c44d54cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1565973
Reviewed-by: Peter Conn <peconn@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Commit-Queue: Pavel Shmakov <pshmakov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653143}
9 files changed