Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1573)

Unified Diff: chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java

Issue 2019363002: Revert of [Sync] Clean up Android test code a bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@signin-test
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java
diff --git a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java
index 3b0616c556ee9145d31445871470a2c53a4b1f7a..fa8d254c57c35fdd21ae82a3b68d24ac4b88774c 100644
--- a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java
+++ b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/FirstRunTest.java
@@ -21,6 +21,8 @@
import org.chromium.chrome.test.util.browser.sync.SyncTestUtil;
import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
+import org.chromium.sync.AndroidSyncSettings;
+import org.chromium.sync.signin.ChromeSigninController;
/**
* Tests for the first run experience.
@@ -43,13 +45,13 @@
@SmallTest
@Feature({"Sync"})
public void testSignIn() throws Exception {
- Account testAccount = SigninTestUtil.addTestAccount();
- assertNull(SigninTestUtil.getCurrentAccount());
- assertFalse(SyncTestUtil.isSyncRequested());
-
+ Account testAccount = SigninTestUtil.get().addTestAccount();
+ SyncTestUtil.verifySyncIsSignedOut();
+ assertFalse(AndroidSyncSettings.isChromeSyncEnabled(mContext));
processFirstRun(testAccount.name, ShowSettings.NO);
- assertEquals(testAccount, SigninTestUtil.getCurrentAccount());
- SyncTestUtil.waitForSyncActive();
+ assertEquals(
+ testAccount.name, ChromeSigninController.get(mContext).getSignedInAccountName());
+ SyncTestUtil.verifySyncIsActiveForAccount(mContext, testAccount);
}
// Test that signing in and opening settings through FirstRun signs in and doesn't fully start
@@ -57,12 +59,13 @@
@SmallTest
@Feature({"Sync"})
public void testSignInWithOpenSettings() throws Exception {
- final Account testAccount = SigninTestUtil.addTestAccount();
+ final Account testAccount = SigninTestUtil.get().addTestAccount();
final Preferences prefActivity = processFirstRun(testAccount.name, ShowSettings.YES);
// User should be signed in and the sync backend should initialize, but sync should not
// become fully active until the settings page is closed.
- assertEquals(testAccount, SigninTestUtil.getCurrentAccount());
+ assertEquals(
+ testAccount.name, ChromeSigninController.get(mContext).getSignedInAccountName());
SyncTestUtil.waitForBackendInitialized();
assertFalse(SyncTestUtil.isSyncActive());
@@ -80,11 +83,13 @@
@SmallTest
@Feature({"Sync"})
public void testNoSignIn() throws Exception {
- SigninTestUtil.addTestAccount();
- assertFalse(SyncTestUtil.isSyncRequested());
+ SigninTestUtil.get().addTestAccount();
+ SyncTestUtil.verifySyncIsSignedOut();
+ assertFalse(AndroidSyncSettings.isChromeSyncEnabled(mContext));
processFirstRun(null, ShowSettings.NO);
- assertNull(SigninTestUtil.getCurrentAccount());
- assertFalse(SyncTestUtil.isSyncRequested());
+ assertNull(ChromeSigninController.get(mContext).getSignedInAccountName());
+ SyncTestUtil.verifySyncIsSignedOut();
+ assertFalse(AndroidSyncSettings.isChromeSyncEnabled(mContext));
}
/**

Powered by Google App Engine
This is Rietveld 408576698