Second step to CTS account manager

- rework the tests strategy with Fred feedback. Now we test passing parameters and giving back results.
- some code refactoring for improving reusability
- add tests for addAccountExplicitly() and removeAccount()
- add test for getAccounts() and getAccountsByType()
- add test for getAuthenticatorTypes()
- take care of Fred second review (except the one with the callback parameter):
	- final for all constants
	- use of mX for member definition
	- improve "if" spacing
	- eliminate reference of the MockAuthenticator into the MockAuthenticatorService
- add test for addAccount() with a callback
- add test for removeAccount() with a callback
- fix non cleaned state for testGetAccountsAndGetAccountsByType()
- improve readability
- add test for setPassword() and getPassword() and clearPassword()
- add test for getUserData() and setUserData()
- add test for getAccountsByTypeAndFeatures()
- suppress non needed interface for constants and migrate them to the test itself
- fix typo
- rework test for getAccountsByTypeAndFeatures()
- fix typo
- add test for setAuthToken() and peekAuthToken() and invalidateAuthToken()
- add test for blockingGetAuthToken()
- improve addAccount() test with checking Options
- add more tests for both getAuthToken() signatures
- add test for confirmCredentials()
- add test for updateCredential()
- add test for editProperties()
- add test for addOnAccountsUpdatedListener()
- add test for removeOnAccountsUpdatedListener()
- code refactoring for suppressing redundencies
- fix missing parenthesis
- take care of Brett second review:
	- use of @Override when needed
	- do not catch exception so that the JUnit runner can deal with them (except for callback as we
	cannot change the API
	- add Javadoc for public methods
	- HAVE NOT changed package name to "com.android.cts.accounts" as Brett and I could not find why the
	tests where blocking
- suppress non needed dumpsys-packages.txt
- add super.setUp() and super.tearDown() calls
- suppressing trailing whitespaces
- take care of Fred second review:
	- renamed LATCH_TIMEOUT to LATCH_TIMEOUT_MS
	- renamed validateAccount() to validateAccountAndAuthTokenType()
	- do not rethrow exceptions when not needed (because taken care by the test framework)
	- confirmed that some retrieved accounts are correct
	- no need to confirm that the callback is called because of the latch itself
- suppress trailing whitespaces again
- fix bug #2342468 (android.accounts.cts.AccountManagerTest#testAddAndRemoveAccount fails if another account is present)
- refactor tests to take care about handlers
- add test for UpdateCredentials() with callback and handler
- take care of Fred third review
	- method renaming
	- code formatting
	- use of array instead of list
	- the comment was correct.
	- add one missing assert
	- suppressed duplicate comment
- fix label and change account authenticator icon for using the Android standard one

Change-Id: I84661fdc108943693947f807dd3f97837cac2a0f
7 files changed
tree: c372b73d4f324e561e5ccb8a6a2738e11b989635
  1. tests/
  2. tools/
  3. .gitignore
  4. Android.mk