Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1a892a9 authored by Hongming Jin's avatar Hongming Jin
Browse files

Test: AccountManagerService APCT test.

Add tests for startUpdateCredentials, finishSession and isCredentialsUpdateSuggested.

Bug: 31346530
Change-Id: I8c93b6b0db50086a83894eadfcf6a2398be81b6c
parent daca8ee6
Loading
Loading
Loading
Loading
+630 −9

File changed.

Preview size limit exceeded, changes collapsed.

+7 −2
Original line number Diff line number Diff line
@@ -197,7 +197,8 @@ public class TestAccountType1Authenticator extends AbstractAccountAuthenticator
            result.putBundle(AccountManager.KEY_ACCOUNT_SESSION_BUNDLE, sessionBundle);
            result.putString(AccountManager.KEY_ACCOUNT_STATUS_TOKEN,
                    AccountManagerServiceTestFixtures.ACCOUNT_STATUS_TOKEN);
            result.putString(AccountManager.KEY_PASSWORD, "doesn't matter");
            result.putString(AccountManager.KEY_PASSWORD,
                    AccountManagerServiceTestFixtures.ACCOUNT_PASSWORD);
            result.putString(AccountManager.KEY_AUTHTOKEN,
                    Integer.toString(mTokenCounter.incrementAndGet()));
        } else if (accountName.equals(
@@ -243,6 +244,8 @@ public class TestAccountType1Authenticator extends AbstractAccountAuthenticator

        Bundle result = new Bundle();
        if (accountName.equals(AccountManagerServiceTestFixtures.ACCOUNT_NAME_SUCCESS)) {
            // add sessionBundle into result for verification purpose
            result.putBundle(AccountManager.KEY_ACCOUNT_SESSION_BUNDLE, sessionBundle);
            // fill bundle with a success result.
            result.putString(AccountManager.KEY_ACCOUNT_NAME,
                    AccountManagerServiceTestFixtures.ACCOUNT_NAME);
@@ -288,7 +291,9 @@ public class TestAccountType1Authenticator extends AbstractAccountAuthenticator
        } else {
            // fill with error
            fillResultWithError(
                    result, AccountManager.ERROR_CODE_INVALID_RESPONSE, "Default Error Message");
                    result,
                    AccountManager.ERROR_CODE_INVALID_RESPONSE,
                    AccountManagerServiceTestFixtures.ERROR_MESSAGE);
        }

        response.onResult(result);