Chromium Code Reviews| Index: chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java |
| diff --git a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java |
| index f967b31ca2fff76d14215f160804ad013aad630e..0376e212eafac9a08e5b55739d2467966fd18777 100644 |
| --- a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java |
| +++ b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncTestBase.java |
| @@ -8,12 +8,13 @@ import android.accounts.Account; |
| import android.content.Context; |
| import org.chromium.base.ThreadUtils; |
| +import org.chromium.chrome.browser.ChromeActivity; |
| import org.chromium.chrome.browser.identity.UniqueIdentificationGenerator; |
| import org.chromium.chrome.browser.identity.UniqueIdentificationGeneratorFactory; |
| import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; |
| import org.chromium.chrome.browser.signin.AccountIdProvider; |
| import org.chromium.chrome.browser.signin.SigninManager; |
| -import org.chromium.chrome.shell.ChromeShellTestBase; |
| +import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
| import org.chromium.chrome.test.util.browser.sync.SyncTestUtil; |
| import org.chromium.sync.AndroidSyncSettings; |
| import org.chromium.sync.internal_api.pub.base.ModelType; |
| @@ -27,7 +28,7 @@ import java.util.Set; |
| /** |
| * Base class for common functionality between sync tests. |
| */ |
| -public class SyncTestBase extends ChromeShellTestBase { |
| +public class SyncTestBase extends ChromeActivityTestCaseBase<ChromeActivity> { |
| private static final String TAG = "SyncTestBase"; |
| protected static final String CLIENT_ID = "Client_ID"; |
| @@ -39,21 +40,33 @@ public class SyncTestBase extends ChromeShellTestBase { |
| protected ProfileSyncService mProfileSyncService; |
| protected MockSyncContentResolverDelegate mSyncContentResolver; |
| + public SyncTestBase() { |
| + super(ChromeActivity.class); |
| + } |
| + |
| + @Override |
| + public void startMainActivity() throws InterruptedException { |
| + // Start the activity by opening about:blank. This URL is ideal because it is not synced as |
| + // a typed URL. If another URL is used, it could interfere with test data. |
| + startMainActivityOnBlankPage(); |
| + } |
| + |
| @Override |
| protected void setUp() throws Exception { |
| + // This must be called before super.setUp() in order for test authentication to work |
| + // properly. |
| + mapAccountNamesToIds(); |
| + |
| super.setUp(); |
| - assertTrue("Clearing app data failed.", clearAppData()); |
|
newt (away)
2015/08/11 21:25:29
Why remove clearAppData()? Clearing app data helps
pval...(no longer on Chromium)
2015/08/14 21:51:10
It's part of ChromeActivityTestCaseBase's setUp no
newt (away)
2015/08/14 22:09:23
Ah, of course :)
|
| Context targetContext = getInstrumentation().getTargetContext(); |
| mContext = new SyncTestUtil.SyncTestContext(targetContext); |
| - mapAccountNamesToIds(); |
| setUpMockAndroidSyncSettings(); |
| setUpMockAccountManager(); |
| // Initializes ChromeSigninController to use our test context. |
| ChromeSigninController.get(mContext); |
| - startChromeBrowserProcessSync(targetContext); |
| ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| @Override |
| public void run() { |
| @@ -70,13 +83,6 @@ public class SyncTestBase extends ChromeShellTestBase { |
| mProfileSyncService = ProfileSyncService.get(mContext); |
| } |
| }); |
| - |
| - // Start the activity by opening about:blank. This URL is ideal because it is not synced as |
| - // a typed URL. If another URL is used, it could interfere with test data. This call is in |
| - // this location so that it takes place before any other calls to getActivity(). If |
| - // getActivity() is called without any prior configuration, an undesired URL |
| - // (e.g., google.com) will be opened. |
| - launchChromeShellWithBlankPage(); |
| } |
| @Override |