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

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

Issue 3792007: Fix some problems with the ENTER_PASSPHRASE state in sync setup.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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/sync/sync_setup_wizard.cc ('k') | chrome/browser/sync/sync_ui_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_setup_wizard_unittest.cc
===================================================================
--- chrome/browser/sync/sync_setup_wizard_unittest.cc (revision 62569)
+++ chrome/browser/sync/sync_setup_wizard_unittest.cc (working copy)
@@ -59,6 +59,10 @@
user_cancelled_dialog_ = true;
}
+ virtual void SetSecondaryPassphrase(const std::string& passphrase) {
+ passphrase_ = passphrase;
+ }
+
virtual string16 GetAuthenticatedUsername() const {
return UTF8ToUTF16(username_);
}
@@ -69,6 +73,10 @@
last_auth_error_ = error;
}
+ void set_passphrase_required(bool required) {
+ observed_passphrase_required_ = required;
+ }
+
void ResetTestStats() {
username_.clear();
password_.clear();
@@ -87,6 +95,8 @@
bool keep_everything_synced_;
syncable::ModelTypeSet chosen_data_types_;
+ std::string passphrase_;
+
private:
DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceForWizardTest);
};
@@ -331,6 +341,22 @@
test_window_->CloseDialog();
}
+TEST_F(SyncSetupWizardTest, EnterPassphraseRequired) {
+ SKIP_TEST_ON_MACOSX();
+ wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
+ wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
+ wizard_->Step(SyncSetupWizard::CONFIGURE);
+ wizard_->Step(SyncSetupWizard::SETTING_UP);
+ service_->set_passphrase_required(true);
+ wizard_->Step(SyncSetupWizard::ENTER_PASSPHRASE);
+ EXPECT_EQ(SyncSetupWizard::ENTER_PASSPHRASE,
+ test_window_->flow()->current_state_);
+ ListValue value;
+ value.Append(new StringValue("{\"passphrase\":\"myPassphrase\"}"));
+ test_window_->flow()->flow_handler_->HandlePassphraseEntry(&value);
+ EXPECT_EQ("myPassphrase", service_->passphrase_);
+}
+
TEST_F(SyncSetupWizardTest, DialogCancelled) {
SKIP_TEST_ON_MACOSX();
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
« no previous file with comments | « chrome/browser/sync/sync_setup_wizard.cc ('k') | chrome/browser/sync/sync_ui_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698