Commit 6ca178d2 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][Test] Refactor SignInWithSyncSetupAsIncomplete in SyncTestRule

This CL refactors the method
SyncTestRule#setUpTestAccountAndSignInWithSyncSetupAsIncomplete() by
replacing its internal sign-in method with sign-in from
AccountManagerTestRule.

Bug: 1126814
Change-Id: Ief0190f97ca45582bf6e9810f56f646aa49414e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2403461
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806100}
parent 2b10f349
......@@ -214,8 +214,10 @@ public class SyncTestRule extends ChromeActivityTestRule<ChromeActivity> {
* @return the test account that is signed in.
*/
public Account setUpTestAccountAndSignInWithSyncSetupAsIncomplete() {
Account account = addTestAccount();
signinAndEnableSyncInternal(account, false);
Account account =
mAccountManagerTestRule.addAndSignInTestAccount(/* profileSyncService= */ null);
enableUKM();
SyncTestUtil.waitForSyncTransportActive();
return account;
}
......@@ -412,6 +414,10 @@ public class SyncTestRule extends ChromeActivityTestRule<ChromeActivity> {
return null;
}
/**
* TODO(https://crbug.com/1126814): Remove this method once all its usages are migrated.
*/
@Deprecated
private void signinAndEnableSyncInternal(final Account account, boolean setFirstSetupComplete) {
TestThreadUtils.runOnUiThreadBlocking(() -> {
IdentityServicesProvider.get()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment