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> { ...@@ -214,8 +214,10 @@ public class SyncTestRule extends ChromeActivityTestRule<ChromeActivity> {
* @return the test account that is signed in. * @return the test account that is signed in.
*/ */
public Account setUpTestAccountAndSignInWithSyncSetupAsIncomplete() { public Account setUpTestAccountAndSignInWithSyncSetupAsIncomplete() {
Account account = addTestAccount(); Account account =
signinAndEnableSyncInternal(account, false); mAccountManagerTestRule.addAndSignInTestAccount(/* profileSyncService= */ null);
enableUKM();
SyncTestUtil.waitForSyncTransportActive();
return account; return account;
} }
...@@ -412,6 +414,10 @@ public class SyncTestRule extends ChromeActivityTestRule<ChromeActivity> { ...@@ -412,6 +414,10 @@ public class SyncTestRule extends ChromeActivityTestRule<ChromeActivity> {
return null; 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) { private void signinAndEnableSyncInternal(final Account account, boolean setFirstSetupComplete) {
TestThreadUtils.runOnUiThreadBlocking(() -> { TestThreadUtils.runOnUiThreadBlocking(() -> {
IdentityServicesProvider.get() 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