[Sync] Ensure isSyncable is set when signed in.
This is a more extensive version of http://crrev.com/
1075343003 for
landing on trunk.
Previously, if isSyncable is false, but sync is enabled for Chrome,
even if you sign in, Chrome would never set syncable to true.
This CL ensures that syncable is always set to true if there is an
account signed in, regardless of whether chrome sync is enabled or not.
Additionally, it sets syncable to false when no account is signed in,
to ensure that the user does not see a non-functional switch in the
Android settings.
The new AccountManager setup in the test is necessary so that the test accounts can be cleaned up by the loop in updateSyncability().
BUG=475299
TEST=Regression tests added, plus:
Ensure that
$ adb shell dumpsys content | grep chrome
should show syncable=0 and enabled=true
Sign in to Chrome. Now dumpsys should say syncable=1 and enabled=true.
Review URL: https://codereview.chromium.org/
1062973004
Cr-Commit-Position: refs/heads/master@{#326122}