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

Unified Diff: chrome/browser/views/sync/sync_setup_wizard_unittest.cc

Issue 270081: Facelifts to sync UI (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « chrome/browser/views/sync/sync_setup_wizard.cc ('k') | chrome/browser/views/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/sync/sync_setup_wizard_unittest.cc
===================================================================
--- chrome/browser/views/sync/sync_setup_wizard_unittest.cc (revision 29168)
+++ chrome/browser/views/sync/sync_setup_wizard_unittest.cc (working copy)
@@ -254,10 +254,11 @@
EXPECT_TRUE(service_->user_accepted_merge_and_sync_);
EXPECT_FALSE(service_->user_cancelled_dialog_);
service_->ResetTestStats();
- wizard_->Step(SyncSetupWizard::DONE); // No merge and sync.
+ wizard_->Step(SyncSetupWizard::DONE_FIRST_TIME); // No merge and sync.
EXPECT_TRUE(wizard_->IsVisible());
EXPECT_FALSE(test_window_->TestAndResetWasShowHTMLDialogCalled());
- EXPECT_EQ(SyncSetupWizard::DONE, test_window_->flow()->current_state_);
+ EXPECT_EQ(SyncSetupWizard::DONE_FIRST_TIME,
+ test_window_->flow()->current_state_);
}
TEST_F(SyncSetupWizardTest, DialogCancelled) {
@@ -294,12 +295,18 @@
EXPECT_FALSE(wizard_->IsVisible());
EXPECT_FALSE(test_window_->TestAndResetWasShowHTMLDialogCalled());
+ wizard_->Step(SyncSetupWizard::DONE_FIRST_TIME);
+ EXPECT_FALSE(wizard_->IsVisible());
+ EXPECT_FALSE(test_window_->TestAndResetWasShowHTMLDialogCalled());
+
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
wizard_->Step(SyncSetupWizard::MERGE_AND_SYNC);
EXPECT_EQ(SyncSetupWizard::GAIA_LOGIN, test_window_->flow()->current_state_);
wizard_->Step(SyncSetupWizard::DONE);
EXPECT_EQ(SyncSetupWizard::GAIA_LOGIN, test_window_->flow()->current_state_);
+ wizard_->Step(SyncSetupWizard::DONE_FIRST_TIME);
+ EXPECT_EQ(SyncSetupWizard::GAIA_LOGIN, test_window_->flow()->current_state_);
wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
wizard_->Step(SyncSetupWizard::MERGE_AND_SYNC);
@@ -325,6 +332,17 @@
prefs::kSyncHasSetupCompleted));
}
+TEST_F(SyncSetupWizardTest, FirstFullSuccessfulRunSetsPref) {
+ wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
+ wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
+ wizard_->Step(SyncSetupWizard::MERGE_AND_SYNC);
+ wizard_->Step(SyncSetupWizard::DONE_FIRST_TIME);
+ test_window_->CloseDialog();
+ EXPECT_FALSE(wizard_->IsVisible());
+ EXPECT_TRUE(service_->profile()->GetPrefs()->GetBoolean(
+ prefs::kSyncHasSetupCompleted));
+}
+
TEST_F(SyncSetupWizardTest, DiscreteRun) {
DictionaryValue dialog_args;
// For a discrete run, we need to have ran through setup once.
« no previous file with comments | « chrome/browser/views/sync/sync_setup_wizard.cc ('k') | chrome/browser/views/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698