diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-18 16:52:09 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-18 16:52:09 +0000 |
commit | 66d8100268972df7034b931a6fa0a9a81b60e17e (patch) | |
tree | 481d9766dcf3d12db5d295a6d6e7f7627eeea968 /chrome/browser/sync/sync_setup_wizard_unittest.cc | |
parent | 051b6ab58d3a2eea6d6f28ab5a6202dd1b34277a (diff) | |
download | chromium_src-66d8100268972df7034b931a6fa0a9a81b60e17e.zip chromium_src-66d8100268972df7034b931a6fa0a9a81b60e17e.tar.gz chromium_src-66d8100268972df7034b931a6fa0a9a81b60e17e.tar.bz2 |
Fix some problems with the ENTER_PASSPHRASE state in sync setup.
BUG=48706
TEST=none
Review URL: http://codereview.chromium.org/3792007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sync_setup_wizard_unittest.cc')
-rw-r--r-- | chrome/browser/sync/sync_setup_wizard_unittest.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/sync/sync_setup_wizard_unittest.cc index aff176a..ba432af 100644 --- a/chrome/browser/sync/sync_setup_wizard_unittest.cc +++ b/chrome/browser/sync/sync_setup_wizard_unittest.cc @@ -59,6 +59,10 @@ class ProfileSyncServiceForWizardTest : public ProfileSyncService { user_cancelled_dialog_ = true; } + virtual void SetSecondaryPassphrase(const std::string& passphrase) { + passphrase_ = passphrase; + } + virtual string16 GetAuthenticatedUsername() const { return UTF8ToUTF16(username_); } @@ -69,6 +73,10 @@ class ProfileSyncServiceForWizardTest : public ProfileSyncService { last_auth_error_ = error; } + void set_passphrase_required(bool required) { + observed_passphrase_required_ = required; + } + void ResetTestStats() { username_.clear(); password_.clear(); @@ -87,6 +95,8 @@ class ProfileSyncServiceForWizardTest : public ProfileSyncService { bool keep_everything_synced_; syncable::ModelTypeSet chosen_data_types_; + std::string passphrase_; + private: DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceForWizardTest); }; @@ -331,6 +341,22 @@ TEST_F(SyncSetupWizardTest, ChooseDataTypesSetsPrefs) { 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); |