Refactor: Reduce some complexity in AndroidSyncSettings and its tests
AndroidSyncSettings exposes a few test methods that take a callback as a parameter, so it is possible to wait for an account update operation to finish. Before this CL, the callback was passed a boolean representing whether syncability was changed. This boolean return value was being used by a single test and can be queried in other ways, so this CL converts the callback into a closure. Apart from this, the CL also: - Adds inline initialization for some members in the test fixture. - Simplifies the waiting mechanism so that individual tests don't have to refer to CallbackHelper directly. - Replaces android.os.StrictMode with org.chromium.base.StrictModeContext in AndroidSyncSettings, which uses a simpler try-with syntax and is already used by some parts of the class. Bug: None Change-Id: Ie7909eba57e171569fc565a02f2ed8afc487e285 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410390Reviewed-by:Marc Treib <treib@chromium.org> Commit-Queue: Victor Vianna <victorvianna@google.com> Cr-Commit-Position: refs/heads/master@{#807453}
Showing
Please register or sign in to comment