Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace most RunLoop in CrostiniManagerRestartTest uses with TestFuture
Most tests of the CrostiniRestarter currently use the helper function RestartCrostiniCallback to wrap the QuitClosure of a RunLoop and store the result of the restart into a member variable. This CL replaces most of these with using TestFuture, which makes the flow easier to follow as the helper function and associated members are not used. Checks of restart_crostini_callback_count_ are no longer relevant and removed. If we can get the TestFutures' results, we know that the relevant result callbacks have been called, and it is not possible for them to be called extra times as they are OnceCallbacks. A few more minor changes while we're here: - Prefer using container_id() to DefaultContainerId() in tests, so we'd notice if we unintentionally expected the default container somewhere in the restart flow. - Add helper functions for restarting that just forward arguments on to make things slightly more readable. - Remove restart_id_ member, don't store the RestartId unless needed. We continue to explicitly use RunLoop::RunUntilIdle in cases where we don't have a callback to wait for. Bug: b/227693911 Change-Id: Ie1013c901e572feb6a382c47b65430f6d7aca465 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4220776 Commit-Queue: Timothy Loh <timloh@chromium.org> Reviewed-by: Sophia Lin <sophialin@google.com> Cr-Commit-Position: refs/heads/main@{#1103685}
- Loading branch information