Commit 4d25c9c4 authored by haitaol@chromium.org's avatar haitaol@chromium.org

Enable rollback by default on trunk (m38).

BUG=362679

Review URL: https://codereview.chromium.org/435463002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287453 0039d316-1c4b-4281-b951-d872f2087c98
parent ad0c14b4
......@@ -41,8 +41,8 @@ void BackupRollbackController::Start(base::TimeDelta delay) {
if (!IsBackupEnabled())
return;
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSyncEnableRollback)) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSyncDisableRollback)) {
sync_prefs_->SetRemainingRollbackTries(0);
}
......
......@@ -117,9 +117,6 @@ TEST_F(BackupRollbackControllerTest, StartOnUserSignedOut) {
}
TEST_F(BackupRollbackControllerTest, StartRollback) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kSyncEnableRollback);
EXPECT_CALL(signin_wrapper_, GetEffectiveUsername())
.Times(2)
.WillOnce(Return("test"))
......@@ -134,18 +131,12 @@ TEST_F(BackupRollbackControllerTest, StartRollback) {
}
TEST_F(BackupRollbackControllerTest, RollbackOnBrowserStart) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kSyncEnableRollback);
fake_prefs_.SetRemainingRollbackTries(1);
controller_->Start(base::TimeDelta());
EXPECT_TRUE(rollback_started_);
}
TEST_F(BackupRollbackControllerTest, BackupAfterRollbackDone) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kSyncEnableRollback);
fake_prefs_.SetRemainingRollbackTries(3);
controller_->Start(base::TimeDelta());
EXPECT_TRUE(rollback_started_);
......@@ -157,9 +148,6 @@ TEST_F(BackupRollbackControllerTest, BackupAfterRollbackDone) {
}
TEST_F(BackupRollbackControllerTest, GiveUpRollback) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kSyncEnableRollback);
fake_prefs_.SetRemainingRollbackTries(3);
for (int i = 0; i < 3; ++i) {
controller_->Start(base::TimeDelta());
......@@ -174,6 +162,9 @@ TEST_F(BackupRollbackControllerTest, GiveUpRollback) {
}
TEST_F(BackupRollbackControllerTest, SkipRollbackIfNotEnabled) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kSyncDisableRollback);
EXPECT_CALL(signin_wrapper_, GetEffectiveUsername())
.Times(2)
.WillOnce(Return("test"))
......
......@@ -543,9 +543,6 @@ TEST_F(ProfileSyncServiceTest, BackupAfterSyncDisabled) {
}
TEST_F(ProfileSyncServiceTest, RollbackThenBackup) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kSyncEnableRollback);
CreateService(browser_sync::MANUAL_START);
service()->SetSyncSetupCompleted();
ExpectDataTypeManagerCreation(3);
......
......@@ -43,9 +43,9 @@ class SingleClientBackupRollbackTest : public SyncTest {
switches::kSyncDisableBackup);
}
void EnableRollback() {
void DisableRollback() {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kSyncEnableRollback);
switches::kSyncDisableRollback);
}
base::Time GetBackupDbLastModified() {
......@@ -135,6 +135,8 @@ IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest,
#endif
IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest,
MAYBE_TestBackupOnly) {
DisableRollback();
ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
// Starting state:
......@@ -185,8 +187,6 @@ IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest,
#endif
IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest,
MAYBE_TestBackupRollback) {
EnableRollback();
ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
// Starting state:
......@@ -253,8 +253,6 @@ IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest,
// backup mode.
IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest,
MAYBE_TestPrefBackupRollback) {
EnableRollback();
ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
preferences_helper::ChangeStringPref(0, prefs::kHomePage, kUrl1);
......@@ -300,8 +298,6 @@ IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest,
#endif
IN_PROC_BROWSER_TEST_F(SingleClientBackupRollbackTest,
MAYBE_RollbackNoBackup) {
EnableRollback();
ASSERT_TRUE(SetupClients()) << "SetupClients() failed.";
// Setup sync, wait for its completion, and make sure changes were synced.
......
......@@ -1174,8 +1174,8 @@ const char kSyncEnableGetUpdateAvoidance[] =
// Disable data backup when user's not signed in.
const char kSyncDisableBackup[] = "disable-sync-backup";
// Enable data rollback when receiving sync rollback command.
const char kSyncEnableRollback[] = "enable-sync-rollback";
// Disable sync rollback.
const char kSyncDisableRollback[] = "disable-sync-rollback";
// Passes the name of the current running automated test to Chrome.
const char kTestName[] = "test-name";
......
......@@ -325,7 +325,7 @@ extern const char kSyncDisableDeferredStartup[];
extern const char kSyncDeferredStartupTimeoutSeconds[];
extern const char kSyncEnableGetUpdateAvoidance[];
extern const char kSyncDisableBackup[];
extern const char kSyncEnableRollback[];
extern const char kSyncDisableRollback[];
extern const char kTabCapture[];
extern const char kTestName[];
extern const char kTrustedSpdyProxy[];
......
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