Commit c005d1f5 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

[Android] Rename SyncTestRule setUpAccountAndSignin method

MOBILE_IDENTITY_CONSISTENCY allows users to be signed in without
syncing. Renaming this method in SyncTestRule to properly reflect what
it does.

Bug: 1135669
Change-Id: I0260636efc98c46a8250d25324ea8763e069e5d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454049
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814690}
parent 2e54d5fd
...@@ -66,7 +66,7 @@ public class PasswordGenerationIntegrationTest { ...@@ -66,7 +66,7 @@ public class PasswordGenerationIntegrationTest {
@Before @Before
public void setUp() throws InterruptedException { public void setUp() throws InterruptedException {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
ManualFillingTestHelper.disableServerPredictions(); ManualFillingTestHelper.disableServerPredictions();
mHelper.loadTestPage(FORM_URL, false); mHelper.loadTestPage(FORM_URL, false);
} }
......
...@@ -57,7 +57,7 @@ public class AutofillUpstreamTest { ...@@ -57,7 +57,7 @@ public class AutofillUpstreamTest {
@Before @Before
public void setUp() { public void setUp() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mServer = new EmbeddedTestServer(); mServer = new EmbeddedTestServer();
mServer.initializeNative(InstrumentationRegistry.getContext(), mServer.initializeNative(InstrumentationRegistry.getContext(),
EmbeddedTestServer.ServerHTTPSSetting.USE_HTTP); EmbeddedTestServer.ServerHTTPSSetting.USE_HTTP);
......
...@@ -108,7 +108,7 @@ import java.io.IOException; ...@@ -108,7 +108,7 @@ import java.io.IOException;
public void testSyncErrorInfoBarNotShownWhenNoError() { public void testSyncErrorInfoBarNotShownWhenNoError() {
Assert.assertEquals("InfoBar should not be shown before signing in", 0, Assert.assertEquals("InfoBar should not be shown before signing in", 0,
mSyncTestRule.getInfoBars().size()); mSyncTestRule.getInfoBars().size());
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
mFakeProfileSyncService.setEngineInitialized(true); mFakeProfileSyncService.setEngineInitialized(true);
mFakeProfileSyncService.setAuthError(GoogleServiceAuthError.State.NONE); mFakeProfileSyncService.setAuthError(GoogleServiceAuthError.State.NONE);
...@@ -182,13 +182,13 @@ import java.io.IOException; ...@@ -182,13 +182,13 @@ import java.io.IOException;
} }
private void showSyncErrorInfoBarForAuthError() { private void showSyncErrorInfoBarForAuthError() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mFakeProfileSyncService.setAuthError(GoogleServiceAuthError.State.INVALID_GAIA_CREDENTIALS); mFakeProfileSyncService.setAuthError(GoogleServiceAuthError.State.INVALID_GAIA_CREDENTIALS);
mSyncTestRule.loadUrlInNewTab(UrlConstants.CHROME_BLANK_URL); mSyncTestRule.loadUrlInNewTab(UrlConstants.CHROME_BLANK_URL);
} }
private void showSyncErrorInfoBarForPassphraseRequired() { private void showSyncErrorInfoBarForPassphraseRequired() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mFakeProfileSyncService.setEngineInitialized(true); mFakeProfileSyncService.setEngineInitialized(true);
mFakeProfileSyncService.setPassphraseRequiredForPreferredDataTypes(true); mFakeProfileSyncService.setPassphraseRequiredForPreferredDataTypes(true);
mSyncTestRule.loadUrlInNewTab(UrlConstants.CHROME_BLANK_URL); mSyncTestRule.loadUrlInNewTab(UrlConstants.CHROME_BLANK_URL);
......
...@@ -158,7 +158,7 @@ public class MainSettingsFragmentTest { ...@@ -158,7 +158,7 @@ public class MainSettingsFragmentTest {
mRenderTestRule.render(view, "main_settings_signed_out"); mRenderTestRule.render(view, "main_settings_signed_out");
// Sign in and render changes. // Sign in and render changes.
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
mRenderTestRule.render(view, "main_settings_signed_in"); mRenderTestRule.render(view, "main_settings_signed_in");
} }
...@@ -175,7 +175,7 @@ public class MainSettingsFragmentTest { ...@@ -175,7 +175,7 @@ public class MainSettingsFragmentTest {
mRenderTestRule.render(view, "main_settings_signed_out_safety_check"); mRenderTestRule.render(view, "main_settings_signed_out_safety_check");
// Sign in and render changes. // Sign in and render changes.
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
mRenderTestRule.render(view, "main_settings_signed_in_safety_check"); mRenderTestRule.render(view, "main_settings_signed_in_safety_check");
} }
...@@ -347,7 +347,7 @@ public class MainSettingsFragmentTest { ...@@ -347,7 +347,7 @@ public class MainSettingsFragmentTest {
mMainSettings.findPreference(MainSettings.PREF_ACCOUNT_SECTION)); mMainSettings.findPreference(MainSettings.PREF_ACCOUNT_SECTION));
// SignIn to see the changes // SignIn to see the changes
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
Assert.assertEquals("SignInPreference should be at the signed in state. ", Assert.assertEquals("SignInPreference should be at the signed in state. ",
signInPreference.getState(), State.SIGNED_IN); signInPreference.getState(), State.SIGNED_IN);
...@@ -375,7 +375,7 @@ public class MainSettingsFragmentTest { ...@@ -375,7 +375,7 @@ public class MainSettingsFragmentTest {
mMainSettings.findPreference(MainSettings.PREF_MANAGE_SYNC).isVisible()); mMainSettings.findPreference(MainSettings.PREF_MANAGE_SYNC).isVisible());
// SignIn to see the changes // SignIn to see the changes
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
Assert.assertEquals("SignInPreference should be at the signed in state. ", Assert.assertEquals("SignInPreference should be at the signed in state. ",
signInPreference.getState(), State.SIGNED_IN); signInPreference.getState(), State.SIGNED_IN);
......
...@@ -76,7 +76,7 @@ public class AutofillTest { ...@@ -76,7 +76,7 @@ public class AutofillTest {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
// Make sure the initial state is clean. // Make sure the initial state is clean.
assertClientAutofillProfileCount(0); assertClientAutofillProfileCount(0);
assertServerAutofillProfileCountWithName(0, STREET); assertServerAutofillProfileCountWithName(0, STREET);
......
...@@ -84,7 +84,7 @@ public class BookmarksTest { ...@@ -84,7 +84,7 @@ public class BookmarksTest {
// Without this call to fake that knowledge for testing, it crashes. // Without this call to fake that knowledge for testing, it crashes.
mBookmarkBridge.loadEmptyPartnerBookmarkShimForTesting(); mBookmarkBridge.loadEmptyPartnerBookmarkShimForTesting();
}); });
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
// Make sure initial state is clean. // Make sure initial state is clean.
assertClientBookmarkCount(0); assertClientBookmarkCount(0);
assertServerBookmarkCountWithName(0, TITLE); assertServerBookmarkCountWithName(0, TITLE);
......
...@@ -108,7 +108,7 @@ public class ManageSyncSettingsTest { ...@@ -108,7 +108,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testSyncEverythingAndDataTypes() { public void testSyncEverythingAndDataTypes() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
ChromeSwitchPreference syncEverything = getSyncEverything(fragment); ChromeSwitchPreference syncEverything = getSyncEverything(fragment);
...@@ -128,7 +128,7 @@ public class ManageSyncSettingsTest { ...@@ -128,7 +128,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testSettingDataTypes() { public void testSettingDataTypes() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
ChromeSwitchPreference syncEverything = getSyncEverything(fragment); ChromeSwitchPreference syncEverything = getSyncEverything(fragment);
...@@ -161,7 +161,7 @@ public class ManageSyncSettingsTest { ...@@ -161,7 +161,7 @@ public class ManageSyncSettingsTest {
@Feature({"Sync"}) @Feature({"Sync"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testUnsettingAllDataTypesStopsSync() { public void testUnsettingAllDataTypesStopsSync() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
...@@ -180,7 +180,7 @@ public class ManageSyncSettingsTest { ...@@ -180,7 +180,7 @@ public class ManageSyncSettingsTest {
@Feature({"Sync"}) @Feature({"Sync"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testSettingAnyDataTypeStartsSync() { public void testSettingAnyDataTypeStartsSync() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setChosenDataTypes(false, new HashSet<>()); mSyncTestRule.setChosenDataTypes(false, new HashSet<>());
mSyncTestRule.stopSync(); mSyncTestRule.stopSync();
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
...@@ -197,7 +197,7 @@ public class ManageSyncSettingsTest { ...@@ -197,7 +197,7 @@ public class ManageSyncSettingsTest {
@Feature({"Sync"}) @Feature({"Sync"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testTogglingSyncEverythingStartsSync() { public void testTogglingSyncEverythingStartsSync() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setChosenDataTypes(false, new HashSet<>()); mSyncTestRule.setChosenDataTypes(false, new HashSet<>());
mSyncTestRule.stopSync(); mSyncTestRule.stopSync();
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
...@@ -212,7 +212,7 @@ public class ManageSyncSettingsTest { ...@@ -212,7 +212,7 @@ public class ManageSyncSettingsTest {
@Feature({"Sync"}) @Feature({"Sync"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testTogglingSyncEverythingDoesNotStopSync() { public void testTogglingSyncEverythingDoesNotStopSync() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setChosenDataTypes(false, new HashSet<>()); mSyncTestRule.setChosenDataTypes(false, new HashSet<>());
mSyncTestRule.startSync(); mSyncTestRule.startSync();
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
...@@ -228,7 +228,7 @@ public class ManageSyncSettingsTest { ...@@ -228,7 +228,7 @@ public class ManageSyncSettingsTest {
@Feature({"Sync"}) @Feature({"Sync"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testPressingTurnOffSyncAndSignOutShowsSignOutDialog() { public void testPressingTurnOffSyncAndSignOutShowsSignOutDialog() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setChosenDataTypes(true, null); mSyncTestRule.setChosenDataTypes(true, null);
mSyncTestRule.startSync(); mSyncTestRule.startSync();
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
...@@ -247,7 +247,7 @@ public class ManageSyncSettingsTest { ...@@ -247,7 +247,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testPaymentsIntegrationChecked() { public void testPaymentsIntegrationChecked() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setPaymentsIntegrationEnabled(true); mSyncTestRule.setPaymentsIntegrationEnabled(true);
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
...@@ -264,7 +264,7 @@ public class ManageSyncSettingsTest { ...@@ -264,7 +264,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testPaymentsIntegrationUnchecked() { public void testPaymentsIntegrationUnchecked() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setPaymentsIntegrationEnabled(false); mSyncTestRule.setPaymentsIntegrationEnabled(false);
mSyncTestRule.setChosenDataTypes(false, UI_DATATYPES.keySet()); mSyncTestRule.setChosenDataTypes(false, UI_DATATYPES.keySet());
...@@ -282,7 +282,7 @@ public class ManageSyncSettingsTest { ...@@ -282,7 +282,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testPaymentsIntegrationCheckboxDisablesPaymentsIntegration() { public void testPaymentsIntegrationCheckboxDisablesPaymentsIntegration() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setPaymentsIntegrationEnabled(true); mSyncTestRule.setPaymentsIntegrationEnabled(true);
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
...@@ -303,7 +303,7 @@ public class ManageSyncSettingsTest { ...@@ -303,7 +303,7 @@ public class ManageSyncSettingsTest {
@FlakyTest(message = "crbug.com/988622") @FlakyTest(message = "crbug.com/988622")
@Feature({"Sync"}) @Feature({"Sync"})
public void testPaymentsIntegrationCheckboxEnablesPaymentsIntegration() { public void testPaymentsIntegrationCheckboxEnablesPaymentsIntegration() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setPaymentsIntegrationEnabled(false); mSyncTestRule.setPaymentsIntegrationEnabled(false);
mSyncTestRule.setChosenDataTypes(false, UI_DATATYPES.keySet()); mSyncTestRule.setChosenDataTypes(false, UI_DATATYPES.keySet());
...@@ -322,7 +322,7 @@ public class ManageSyncSettingsTest { ...@@ -322,7 +322,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testPaymentsIntegrationCheckboxClearsServerAutofillCreditCards() { public void testPaymentsIntegrationCheckboxClearsServerAutofillCreditCards() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setPaymentsIntegrationEnabled(true); mSyncTestRule.setPaymentsIntegrationEnabled(true);
Assert.assertFalse( Assert.assertFalse(
...@@ -351,7 +351,7 @@ public class ManageSyncSettingsTest { ...@@ -351,7 +351,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testPaymentsIntegrationDisabledByAutofillSyncCheckbox() { public void testPaymentsIntegrationDisabledByAutofillSyncCheckbox() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setPaymentsIntegrationEnabled(true); mSyncTestRule.setPaymentsIntegrationEnabled(true);
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
...@@ -376,7 +376,7 @@ public class ManageSyncSettingsTest { ...@@ -376,7 +376,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testPaymentsIntegrationEnabledBySyncEverything() { public void testPaymentsIntegrationEnabledBySyncEverything() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setPaymentsIntegrationEnabled(false); mSyncTestRule.setPaymentsIntegrationEnabled(false);
mSyncTestRule.disableDataType(ModelType.AUTOFILL); mSyncTestRule.disableDataType(ModelType.AUTOFILL);
...@@ -417,7 +417,7 @@ public class ManageSyncSettingsTest { ...@@ -417,7 +417,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testChoosePassphraseTypeWhenSyncIsOff() { public void testChoosePassphraseTypeWhenSyncIsOff() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
ManageSyncSettings fragment = startManageSyncPreferences(); ManageSyncSettings fragment = startManageSyncPreferences();
Preference encryption = getEncryption(fragment); Preference encryption = getEncryption(fragment);
...@@ -438,7 +438,7 @@ public class ManageSyncSettingsTest { ...@@ -438,7 +438,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testEnterPassphraseWhenSyncIsOff() { public void testEnterPassphraseWhenSyncIsOff() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
final ManageSyncSettings fragment = startManageSyncPreferences(); final ManageSyncSettings fragment = startManageSyncPreferences();
mSyncTestRule.stopSync(); mSyncTestRule.stopSync();
...@@ -451,7 +451,7 @@ public class ManageSyncSettingsTest { ...@@ -451,7 +451,7 @@ public class ManageSyncSettingsTest {
@SmallTest @SmallTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testPassphraseCreation() { public void testPassphraseCreation() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
final ManageSyncSettings fragment = startManageSyncPreferences(); final ManageSyncSettings fragment = startManageSyncPreferences();
TestThreadUtils.runOnUiThreadBlocking( TestThreadUtils.runOnUiThreadBlocking(
...@@ -528,7 +528,7 @@ public class ManageSyncSettingsTest { ...@@ -528,7 +528,7 @@ public class ManageSyncSettingsTest {
Collections.singletonList(trustedVaultKey)); Collections.singletonList(trustedVaultKey));
mSyncTestRule.getFakeServerHelper().setTrustedVaultNigori(trustedVaultKey); mSyncTestRule.getFakeServerHelper().setTrustedVaultNigori(trustedVaultKey);
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
// Initially FakeTrustedVaultClientBackend doesn't provide any keys, so PSS should remain // Initially FakeTrustedVaultClientBackend doesn't provide any keys, so PSS should remain
// in TrustedVaultKeyRequired state. // in TrustedVaultKeyRequired state.
...@@ -550,7 +550,7 @@ public class ManageSyncSettingsTest { ...@@ -550,7 +550,7 @@ public class ManageSyncSettingsTest {
@Feature({"Sync"}) @Feature({"Sync"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testAdvancedSyncFlowPreferencesAndBottomBarShown() { public void testAdvancedSyncFlowPreferencesAndBottomBarShown() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow(); final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow();
Assert.assertTrue( Assert.assertTrue(
...@@ -567,7 +567,7 @@ public class ManageSyncSettingsTest { ...@@ -567,7 +567,7 @@ public class ManageSyncSettingsTest {
@Feature({"Sync", "RenderTest"}) @Feature({"Sync", "RenderTest"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testAdvancedSyncFlowTopView() throws Exception { public void testAdvancedSyncFlowTopView() throws Exception {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow(); final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow();
InstrumentationRegistry.getInstrumentation().waitForIdleSync(); InstrumentationRegistry.getInstrumentation().waitForIdleSync();
...@@ -579,7 +579,7 @@ public class ManageSyncSettingsTest { ...@@ -579,7 +579,7 @@ public class ManageSyncSettingsTest {
@Feature({"Sync", "RenderTest"}) @Feature({"Sync", "RenderTest"})
@Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY) @Features.EnableFeatures(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
public void testAdvancedSyncFlowBottomView() throws Exception { public void testAdvancedSyncFlowBottomView() throws Exception {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow(); final ManageSyncSettings fragment = startManageSyncPreferencesFromSyncConsentFlow();
TestThreadUtils.runOnUiThreadBlocking(() -> { TestThreadUtils.runOnUiThreadBlocking(() -> {
......
...@@ -58,7 +58,7 @@ public class ManageSyncSettingsWithFakeProfileSyncServiceTest { ...@@ -58,7 +58,7 @@ public class ManageSyncSettingsWithFakeProfileSyncServiceTest {
final FakeProfileSyncService fakeProfileSyncService = final FakeProfileSyncService fakeProfileSyncService =
(FakeProfileSyncService) mSyncTestRule.getProfileSyncService(); (FakeProfileSyncService) mSyncTestRule.getProfileSyncService();
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
// Trigger PassphraseDialogFragment to be shown when taping on Encryption. // Trigger PassphraseDialogFragment to be shown when taping on Encryption.
fakeProfileSyncService.setPassphraseRequiredForPreferredDataTypes(true); fakeProfileSyncService.setPassphraseRequiredForPreferredDataTypes(true);
......
...@@ -93,7 +93,7 @@ public class OpenTabsTest { ...@@ -93,7 +93,7 @@ public class OpenTabsTest {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mClientName = getClientName(); mClientName = getClientName();
mSessionTagCounter = 0; mSessionTagCounter = 0;
} }
......
...@@ -63,7 +63,7 @@ public class SyncAndServicesSettingsTest { ...@@ -63,7 +63,7 @@ public class SyncAndServicesSettingsTest {
@LargeTest @LargeTest
@Feature({"Sync", "Preferences"}) @Feature({"Sync", "Preferences"})
public void testSyncSwitch() { public void testSyncSwitch() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
SyncAndServicesSettings fragment = startSyncAndServicesPreferences(); SyncAndServicesSettings fragment = startSyncAndServicesPreferences();
final ChromeSwitchPreference syncSwitch = getSyncSwitch(fragment); final ChromeSwitchPreference syncSwitch = getSyncSwitch(fragment);
...@@ -85,7 +85,7 @@ public class SyncAndServicesSettingsTest { ...@@ -85,7 +85,7 @@ public class SyncAndServicesSettingsTest {
@LargeTest @LargeTest
@Feature({"Sync", "Preferences"}) @Feature({"Sync", "Preferences"})
public void testOpeningSettingsDoesntEnableSync() { public void testOpeningSettingsDoesntEnableSync() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.stopSync(); mSyncTestRule.stopSync();
SyncAndServicesSettings fragment = startSyncAndServicesPreferences(); SyncAndServicesSettings fragment = startSyncAndServicesPreferences();
closeFragment(fragment); closeFragment(fragment);
...@@ -99,7 +99,7 @@ public class SyncAndServicesSettingsTest { ...@@ -99,7 +99,7 @@ public class SyncAndServicesSettingsTest {
@LargeTest @LargeTest
@Feature({"Sync", "Preferences"}) @Feature({"Sync", "Preferences"})
public void testOpeningSettingsDoesntStartEngine() { public void testOpeningSettingsDoesntStartEngine() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.stopSync(); mSyncTestRule.stopSync();
startSyncAndServicesPreferences(); startSyncAndServicesPreferences();
TestThreadUtils.runOnUiThreadBlocking(() -> { TestThreadUtils.runOnUiThreadBlocking(() -> {
...@@ -111,7 +111,7 @@ public class SyncAndServicesSettingsTest { ...@@ -111,7 +111,7 @@ public class SyncAndServicesSettingsTest {
@LargeTest @LargeTest
@Feature({"Sync", "Preferences"}) @Feature({"Sync", "Preferences"})
public void testDefaultControlStatesWithSyncOffThenOn() { public void testDefaultControlStatesWithSyncOffThenOn() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.stopSync(); mSyncTestRule.stopSync();
SyncAndServicesSettings fragment = startSyncAndServicesPreferences(); SyncAndServicesSettings fragment = startSyncAndServicesPreferences();
assertSyncOffState(fragment); assertSyncOffState(fragment);
...@@ -124,7 +124,7 @@ public class SyncAndServicesSettingsTest { ...@@ -124,7 +124,7 @@ public class SyncAndServicesSettingsTest {
@LargeTest @LargeTest
@Feature({"Sync", "Preferences"}) @Feature({"Sync", "Preferences"})
public void testDefaultControlStatesWithSyncOnThenOff() { public void testDefaultControlStatesWithSyncOnThenOff() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
SyncAndServicesSettings fragment = startSyncAndServicesPreferences(); SyncAndServicesSettings fragment = startSyncAndServicesPreferences();
assertSyncOnState(fragment); assertSyncOnState(fragment);
...@@ -137,7 +137,7 @@ public class SyncAndServicesSettingsTest { ...@@ -137,7 +137,7 @@ public class SyncAndServicesSettingsTest {
@Feature({"Sync", "Preferences"}) @Feature({"Sync", "Preferences"})
@DisabledTest(message = "https://crbug.com/991135") @DisabledTest(message = "https://crbug.com/991135")
public void testSyncSwitchClearsServerAutofillCreditCards() { public void testSyncSwitchClearsServerAutofillCreditCards() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.setPaymentsIntegrationEnabled(true); mSyncTestRule.setPaymentsIntegrationEnabled(true);
Assert.assertFalse( Assert.assertFalse(
......
...@@ -44,7 +44,7 @@ public class SyncAndServicesSettingsWithFakeProfileSyncServiceTest { ...@@ -44,7 +44,7 @@ public class SyncAndServicesSettingsWithFakeProfileSyncServiceTest {
public void testTrustedVaultKeyRequiredShowsSyncErrorCard() throws Exception { public void testTrustedVaultKeyRequiredShowsSyncErrorCard() throws Exception {
FakeProfileSyncService fakeProfileSyncService = FakeProfileSyncService fakeProfileSyncService =
(FakeProfileSyncService) mSyncTestRule.getProfileSyncService(); (FakeProfileSyncService) mSyncTestRule.getProfileSyncService();
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
SyncTestUtil.waitForSyncActive(); SyncTestUtil.waitForSyncActive();
fakeProfileSyncService.setEngineInitialized(true); fakeProfileSyncService.setEngineInitialized(true);
fakeProfileSyncService.setTrustedVaultKeyRequiredForPreferredDataTypes(true); fakeProfileSyncService.setTrustedVaultKeyRequiredForPreferredDataTypes(true);
......
...@@ -48,7 +48,7 @@ public class SyncTest { ...@@ -48,7 +48,7 @@ public class SyncTest {
@LargeTest @LargeTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testSignInAndOut() { public void testSignInAndOut() {
Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Account account = mSyncTestRule.setUpAccountAndEnableSyncForTesting();
// Signing out should disable sync. // Signing out should disable sync.
mSyncTestRule.signOut(); mSyncTestRule.signOut();
...@@ -63,7 +63,7 @@ public class SyncTest { ...@@ -63,7 +63,7 @@ public class SyncTest {
@LargeTest @LargeTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testStopAndClear() { public void testStopAndClear() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
CriteriaHelper.pollUiThread( CriteriaHelper.pollUiThread(
() ()
-> IdentityServicesProvider.get() -> IdentityServicesProvider.get()
...@@ -95,7 +95,7 @@ public class SyncTest { ...@@ -95,7 +95,7 @@ public class SyncTest {
@DisabledTest(message = "crbug.com/588050,crbug.com/595893") @DisabledTest(message = "crbug.com/588050,crbug.com/595893")
public void testRename() { public void testRename() {
// The two accounts object that would represent the account rename. // The two accounts object that would represent the account rename.
final Account oldAccount = mSyncTestRule.setUpAccountAndSignInForTesting(); final Account oldAccount = mSyncTestRule.setUpAccountAndEnableSyncForTesting();
final Account newAccount = mSyncTestRule.addAccount("test2@gmail.com"); final Account newAccount = mSyncTestRule.addAccount("test2@gmail.com");
TestThreadUtils.runOnUiThreadBlocking(() -> { TestThreadUtils.runOnUiThreadBlocking(() -> {
...@@ -133,7 +133,7 @@ public class SyncTest { ...@@ -133,7 +133,7 @@ public class SyncTest {
@LargeTest @LargeTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testStopAndStartSync() { public void testStopAndStartSync() {
Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Account account = mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.stopSync(); mSyncTestRule.stopSync();
Assert.assertEquals(account, mSyncTestRule.getCurrentSignedInAccount()); Assert.assertEquals(account, mSyncTestRule.getCurrentSignedInAccount());
...@@ -146,7 +146,7 @@ public class SyncTest { ...@@ -146,7 +146,7 @@ public class SyncTest {
@LargeTest @LargeTest
@Feature({"Sync"}) @Feature({"Sync"})
public void testStopAndStartSyncThroughAndroidChromeSync() { public void testStopAndStartSyncThroughAndroidChromeSync() {
Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Account account = mSyncTestRule.setUpAccountAndEnableSyncForTesting();
String authority = AndroidSyncSettings.getContractAuthority(); String authority = AndroidSyncSettings.getContractAuthority();
Assert.assertTrue(AndroidSyncSettingsTestUtils.getIsSyncEnabledOnUiThread()); Assert.assertTrue(AndroidSyncSettingsTestUtils.getIsSyncEnabledOnUiThread());
...@@ -167,7 +167,7 @@ public class SyncTest { ...@@ -167,7 +167,7 @@ public class SyncTest {
@Feature({"Sync"}) @Feature({"Sync"})
@DisabledTest(message = "crbug.com/1103515") @DisabledTest(message = "crbug.com/1103515")
public void testStopAndStartSyncThroughAndroidMasterSync() { public void testStopAndStartSyncThroughAndroidMasterSync() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
Assert.assertTrue(AndroidSyncSettingsTestUtils.getIsSyncEnabledOnUiThread()); Assert.assertTrue(AndroidSyncSettingsTestUtils.getIsSyncEnabledOnUiThread());
Assert.assertTrue(SyncTestUtil.isSyncRequested()); Assert.assertTrue(SyncTestUtil.isSyncRequested());
...@@ -187,7 +187,7 @@ public class SyncTest { ...@@ -187,7 +187,7 @@ public class SyncTest {
@Features.DisableFeatures(ChromeFeatureList.DECOUPLE_SYNC_FROM_ANDROID_MASTER_SYNC) @Features.DisableFeatures(ChromeFeatureList.DECOUPLE_SYNC_FROM_ANDROID_MASTER_SYNC)
@DisabledTest(message = "Test is flaky crbug.com/1100890") @DisabledTest(message = "Test is flaky crbug.com/1100890")
public void testReenableMasterSyncFirst() { public void testReenableMasterSyncFirst() {
Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Account account = mSyncTestRule.setUpAccountAndEnableSyncForTesting();
String authority = AndroidSyncSettings.getContractAuthority(); String authority = AndroidSyncSettings.getContractAuthority();
Assert.assertTrue(AndroidSyncSettingsTestUtils.getIsSyncEnabledOnUiThread()); Assert.assertTrue(AndroidSyncSettingsTestUtils.getIsSyncEnabledOnUiThread());
...@@ -220,7 +220,7 @@ public class SyncTest { ...@@ -220,7 +220,7 @@ public class SyncTest {
@Features.DisableFeatures(ChromeFeatureList.DECOUPLE_SYNC_FROM_ANDROID_MASTER_SYNC) @Features.DisableFeatures(ChromeFeatureList.DECOUPLE_SYNC_FROM_ANDROID_MASTER_SYNC)
@Feature({"Sync"}) @Feature({"Sync"})
public void testReenableChromeSyncFirst() { public void testReenableChromeSyncFirst() {
Account account = mSyncTestRule.setUpAccountAndSignInForTesting(); Account account = mSyncTestRule.setUpAccountAndEnableSyncForTesting();
String authority = AndroidSyncSettings.getContractAuthority(); String authority = AndroidSyncSettings.getContractAuthority();
Assert.assertTrue(AndroidSyncSettingsTestUtils.getIsSyncEnabledOnUiThread()); Assert.assertTrue(AndroidSyncSettingsTestUtils.getIsSyncEnabledOnUiThread());
...@@ -253,7 +253,7 @@ public class SyncTest { ...@@ -253,7 +253,7 @@ public class SyncTest {
@Features.DisableFeatures(ChromeFeatureList.DECOUPLE_SYNC_FROM_ANDROID_MASTER_SYNC) @Features.DisableFeatures(ChromeFeatureList.DECOUPLE_SYNC_FROM_ANDROID_MASTER_SYNC)
@Feature({"Sync"}) @Feature({"Sync"})
public void testMasterSyncBlocksSyncStart() { public void testMasterSyncBlocksSyncStart() {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
mSyncTestRule.stopSync(); mSyncTestRule.stopSync();
Assert.assertFalse(SyncTestUtil.isSyncRequested()); Assert.assertFalse(SyncTestUtil.isSyncRequested());
......
...@@ -198,7 +198,7 @@ public class SyncTestRule extends ChromeActivityTestRule<ChromeActivity> { ...@@ -198,7 +198,7 @@ public class SyncTestRule extends ChromeActivityTestRule<ChromeActivity> {
* this. For most purposes this function should be used as this emulates the basic sign in flow. * this. For most purposes this function should be used as this emulates the basic sign in flow.
* @return the test account that is signed in. * @return the test account that is signed in.
*/ */
public Account setUpAccountAndSignInForTesting() { public Account setUpAccountAndEnableSyncForTesting() {
Account account = Account account =
mAccountManagerTestRule.addTestAccountThenSigninAndEnableSync(mProfileSyncService); mAccountManagerTestRule.addTestAccountThenSigninAndEnableSync(mProfileSyncService);
enableUKM(); enableUKM();
......
...@@ -69,7 +69,7 @@ public class TypedUrlsTest { ...@@ -69,7 +69,7 @@ public class TypedUrlsTest {
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
mSyncTestRule.setUpAccountAndSignInForTesting(); mSyncTestRule.setUpAccountAndEnableSyncForTesting();
// Make sure the initial state is clean. // Make sure the initial state is clean.
assertClientTypedUrlCount(0); assertClientTypedUrlCount(0);
assertServerTypedUrlCountWithName(0, URL); assertServerTypedUrlCountWithName(0, URL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment