Commit 638d43e3 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

Add signIn method test for SigninManagerTest

Add a test to check the signIn method in SigninManagerTest

Bug: 1059964
Change-Id: I953d4344fc50b892b793d6045aa7bf77d246141c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2095128Reviewed-by: default avatarAlice Wang <aliceywang@chromium.org>
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751363}
parent 831f36d8
......@@ -10,6 +10,7 @@ import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
......@@ -91,6 +92,20 @@ public class SigninManagerTest {
new CoreAccountId("gaia-id-user"), "user@domain.com", "gaia-id-user");
}
@Test
public void signInFromJava() {
doReturn(true).when(mAccountTrackerService).checkAndSeedSystemAccounts();
doReturn(mAccount)
.when(mIdentityManager)
.findExtendedAccountInfoForAccountWithRefreshTokenByEmailAddress(
eq(mAccount.getEmail()));
mSigninManager.onFirstRunCheckDone();
mSigninManager.signIn(SigninAccessPoint.START_PAGE, mAccount, null);
verify(mNativeMock).fetchAndApplyCloudPolicy(anyLong(), eq(mAccount), any());
}
@Test
public void signOutFromJavaWithManagedDomain() {
// Stub out various native calls. Some of these are verified as never called
......
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