Inject a fake ConversionManager into ConversionHostTest.*
This change fixes flakes found in the ConversionHostTest suite. These flakes are currently caused by a race between storage initialization and test profile deletion. If the test profile is deleted prior to the storage initialization task finishing, the task can hang in the middle due to so undefined behavior of operating on the db causing the test to timeout. These tests do not need a real ConversionManager and only require a valid pointer. This change allows ConversionHostTest to specify a TestConversionManager which is injected via new layer of abstraction, the ConversionManagerProvider. It also switches ConversionManager to an impl pattern rather than marking all methods virtual. This test manager does not need to initialize a storage layer, fixing the timeout issue. This is also a pre-requisite for https://crrev.com/c/2012883, which requires a mock manager to fully test ConversionHost functionality. Bug: 1051334 Change-Id: I376382c2d859e7c2ee8512227d40657082348310 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135061 Commit-Queue: John Delaney <johnidel@chromium.org> Reviewed-by:Charlie Harrison <csharrison@chromium.org> Reviewed-by:
Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#756810}
Showing
Please register or sign in to comment