| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.test.util.browser.signin; | 5 package org.chromium.chrome.test.util.browser.signin; |
| 6 | 6 |
| 7 import android.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.app.Instrumentation; | 8 import android.app.Instrumentation; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 | 10 |
| 11 import org.chromium.base.ContextUtils; | 11 import org.chromium.base.ContextUtils; |
| 12 import org.chromium.base.ThreadUtils; | 12 import org.chromium.base.ThreadUtils; |
| 13 import org.chromium.chrome.browser.signin.AccountIdProvider; | 13 import org.chromium.chrome.browser.signin.AccountIdProvider; |
| 14 import org.chromium.chrome.browser.signin.AccountTrackerService; | 14 import org.chromium.chrome.browser.signin.AccountTrackerService; |
| 15 import org.chromium.chrome.browser.signin.OAuth2TokenService; | 15 import org.chromium.chrome.browser.signin.OAuth2TokenService; |
| 16 import org.chromium.sync.signin.AccountManagerHelper; | 16 import org.chromium.components.sync.signin.AccountManagerHelper; |
| 17 import org.chromium.sync.signin.ChromeSigninController; | 17 import org.chromium.components.sync.signin.ChromeSigninController; |
| 18 import org.chromium.sync.test.util.AccountHolder; | 18 import org.chromium.components.sync.test.util.AccountHolder; |
| 19 import org.chromium.sync.test.util.MockAccountManager; | 19 import org.chromium.components.sync.test.util.MockAccountManager; |
| 20 | 20 |
| 21 import java.util.HashSet; | 21 import java.util.HashSet; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Utility class for test signin functionality. | 24 * Utility class for test signin functionality. |
| 25 */ | 25 */ |
| 26 public final class SigninTestUtil { | 26 public final class SigninTestUtil { |
| 27 private static final String TAG = "Signin"; | 27 private static final String TAG = "Signin"; |
| 28 | 28 |
| 29 private static final String DEFAULT_ACCOUNT = "test@gmail.com"; | 29 private static final String DEFAULT_ACCOUNT = "test@gmail.com"; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Clear cached signed account name and accounts list. | 125 // Clear cached signed account name and accounts list. |
| 126 ChromeSigninController.get(sContext).setSignedInAccountName(null); | 126 ChromeSigninController.get(sContext).setSignedInAccountName(null); |
| 127 ContextUtils.getAppSharedPreferences() | 127 ContextUtils.getAppSharedPreferences() |
| 128 .edit() | 128 .edit() |
| 129 .putStringSet(OAuth2TokenService.STORED_ACCOUNTS_KEY, new HashSe
t<String>()) | 129 .putStringSet(OAuth2TokenService.STORED_ACCOUNTS_KEY, new HashSe
t<String>()) |
| 130 .apply(); | 130 .apply(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 private SigninTestUtil() {} | 133 private SigninTestUtil() {} |
| 134 } | 134 } |
| OLD | NEW |