Migrate UkmBrowserTests to SyncUserSettings

SyncUserSettings is a new class that encapsulates all the
user-configurable knobs for Sync. It replaces a bunch of setters
and getters directly on the SyncService.

Here, a bunch of calls to RequestStart and RequestStop are replaced by
GetUserSettings()->SetSyncRequested(bool).
SetSyncRequested(false) is equivalent to RequestStop(KEEP_DATA), but
it is also used to replace a bunch of RequestStop(CLEAR_DATA) calls.
However:
- These calls are all at the end of a test, so it doesn't matter if
  data is kept or not. (In fact, these calls actually aren't necessary
  at all, but for some reason, without them the test shutdown takes
  much longer. See also https://crrev.com/c/557422).
- RequestStop(CLEAR_DATA) is generally a pretty weird thing to do:
  Usually it only happens if the user signs out (removes the primary
  account); it ~never needs to be called directly. So this change makes
  the tests a bit less weird / more realistic.

Bug: 884159
Change-Id: I0e2347bbabdeb10846528fe03732a05ba996f43f
Reviewed-on: https://chromium-review.googlesource.com/c/1352180
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613477}
1 file changed