[DevUI DFM] Improve DevUiModuleProvider testability.
Previously, class DevUiModuleProvider consists of static functions {ModuleInstalled(), InstallModule(), LoadModule} that are called directly. Unfortunately, these cannot be mocked for testing. This CL makes DevUiModuleProvider a singleton class that's accessed via GetInstance(). SetTestInstance() is added to allow a test to override DevUiModuleProvider functions, and inject a test instance that replaces the original singleton obtained from GetInstance(). Bug: 927131 TBR: yfriedman@chromium.org Change-Id: Ifee6899ebf67be17ad2ed15103b9c7b6d8e322a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863553Reviewed-by:Samuel Huang <huangs@chromium.org> Reviewed-by:
Tibor Goldschwendt <tiborg@chromium.org> Reviewed-by:
Andrew Grieve <agrieve@chromium.org> Commit-Queue: Samuel Huang <huangs@chromium.org> Cr-Commit-Position: refs/heads/master@{#706160}
Showing
Please register or sign in to comment