Commit 1d02a4c1 authored by Alice Wang's avatar Alice Wang Committed by Commit Bot

[Android][Test] Simplify identity manager test with AccountManagerTestRule

This CL simplifies identity manager tests' setup with
AccountManagerTestRule.

Bug: 1120301
Change-Id: I9ee0af5a144b582739a87b53dd8f8cd73c6eed44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369093Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Alice Wang <aliceywang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801787}
parent c668d450
...@@ -16,8 +16,6 @@ import org.junit.runner.RunWith; ...@@ -16,8 +16,6 @@ import org.junit.runner.RunWith;
import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.BaseJUnit4ClassRunner;
import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule; import org.chromium.chrome.test.util.browser.signin.AccountManagerTestRule;
import org.chromium.components.signin.AccountManagerFacadeProvider;
import org.chromium.components.signin.base.CoreAccountId;
import org.chromium.components.signin.base.CoreAccountInfo; import org.chromium.components.signin.base.CoreAccountInfo;
import org.chromium.components.signin.identitymanager.IdentityManager; import org.chromium.components.signin.identitymanager.IdentityManager;
import org.chromium.components.signin.identitymanager.IdentityMutator; import org.chromium.components.signin.identitymanager.IdentityMutator;
...@@ -48,8 +46,8 @@ public class IdentityManagerIntegrationTest { ...@@ -48,8 +46,8 @@ public class IdentityManagerIntegrationTest {
@Before @Before
public void setUp() { public void setUp() {
mTestAccount1 = createCoreAccountInfoFromEmail(TEST_ACCOUNT1); mTestAccount1 = mAccountManagerTestRule.toCoreAccountInfo(TEST_ACCOUNT1);
mTestAccount2 = createCoreAccountInfoFromEmail(TEST_ACCOUNT2); mTestAccount2 = mAccountManagerTestRule.toCoreAccountInfo(TEST_ACCOUNT2);
NativeLibraryTestUtils.loadNativeLibraryAndInitBrowserProcess(); NativeLibraryTestUtils.loadNativeLibraryAndInitBrowserProcess();
...@@ -62,12 +60,6 @@ public class IdentityManagerIntegrationTest { ...@@ -62,12 +60,6 @@ public class IdentityManagerIntegrationTest {
}); });
} }
private static CoreAccountInfo createCoreAccountInfoFromEmail(String accountEmail) {
String accountGaiaId =
AccountManagerFacadeProvider.getInstance().getAccountGaiaId(accountEmail);
return new CoreAccountInfo(new CoreAccountId(accountGaiaId), accountEmail, accountGaiaId);
}
@After @After
public void tearDown() { public void tearDown() {
TestThreadUtils.runOnUiThreadBlocking( TestThreadUtils.runOnUiThreadBlocking(
......
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