summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/sync_setup_wizard_unittest.cc
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-11 22:57:46 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-11 22:57:46 +0000
commit712257e6ca930697de2a5c1d5e0a4311262e5a2c (patch)
tree0da9814073776ad59689620f2b21716ec8d28e7f /chrome/browser/sync/sync_setup_wizard_unittest.cc
parent4efb56d87a1927f4e497257805b54ad3bda87bec (diff)
downloadchromium_src-712257e6ca930697de2a5c1d5e0a4311262e5a2c.zip
chromium_src-712257e6ca930697de2a5c1d5e0a4311262e5a2c.tar.gz
chromium_src-712257e6ca930697de2a5c1d5e0a4311262e5a2c.tar.bz2
Part 1 of implementing captcha for sync dialog.
Added GoogleServiceAuthError, which is the same as the incumbent AuthErrorState but can support captcha information too. I moved it because it just had nothing specific to sync about it. This CL is mostly a rename and basic plumbing CaptchaRequired error state from browser_sync::AuthWatcher through to UI thread. Ben, I added a .h to chrome/browser/ alongside other google_* stuff. I'm just looking for your blessing here, or suggestion of alternate location. BUG=19738 Review URL: http://codereview.chromium.org/384040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31729 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.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/sync/sync_setup_wizard_unittest.cc b/chrome/browser/sync/sync_setup_wizard_unittest.cc
index bf5ee91..ba9e8d9 100644
--- a/chrome/browser/sync/sync_setup_wizard_unittest.cc
+++ b/chrome/browser/sync/sync_setup_wizard_unittest.cc
@@ -9,6 +9,7 @@
#include "base/stl_util-inl.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
+#include "chrome/browser/google_service_auth_error.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_setup_flow.h"
#include "chrome/browser/sync/sync_setup_wizard.h"
@@ -21,6 +22,8 @@
static const char* kTestUser = "chrome.p13n.test@gmail.com";
static const char* kTestPassword = "passwd";
+typedef GoogleServiceAuthError AuthError;
+
// A PSS subtype to inject.
class ProfileSyncServiceForWizardTest : public ProfileSyncService {
public:
@@ -48,9 +51,10 @@ class ProfileSyncServiceForWizardTest : public ProfileSyncService {
return UTF8ToUTF16(username_);
}
- void set_auth_state(const std::string& last_email, AuthErrorState state) {
+ void set_auth_state(const std::string& last_email,
+ const AuthError::State& state) {
last_attempted_user_email_ = last_email;
- last_auth_error_ = state;
+ last_auth_error_ = AuthError(state);
}
void ResetTestStats() {
@@ -208,7 +212,7 @@ TEST_F(SyncSetupWizardTest, InitialStepLogin) {
service_->ResetTestStats();
// Simulate failed credentials.
- service_->set_auth_state(kTestUser, AUTH_ERROR_INVALID_GAIA_CREDENTIALS);
+ service_->set_auth_state(kTestUser, AuthError::INVALID_GAIA_CREDENTIALS);
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
EXPECT_TRUE(wizard_->IsVisible());
EXPECT_FALSE(test_window_->TestAndResetWasShowHTMLDialogCalled());
@@ -221,8 +225,8 @@ TEST_F(SyncSetupWizardTest, InitialStepLogin) {
EXPECT_EQ(kTestUser, actual_user);
int error = -1;
dialog_args.GetInteger(L"error", &error);
- EXPECT_EQ(static_cast<int>(AUTH_ERROR_INVALID_GAIA_CREDENTIALS), error);
- service_->set_auth_state(kTestUser, AUTH_ERROR_NONE);
+ EXPECT_EQ(static_cast<int>(AuthError::INVALID_GAIA_CREDENTIALS), error);
+ service_->set_auth_state(kTestUser, AuthError::NONE);
// Simulate success.
wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
@@ -361,7 +365,7 @@ TEST_F(SyncSetupWizardTest, DiscreteRun) {
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
EXPECT_EQ(SyncSetupWizard::GAIA_SUCCESS, test_window_->flow()->end_state_);
- service_->set_auth_state(kTestUser, AUTH_ERROR_INVALID_GAIA_CREDENTIALS);
+ service_->set_auth_state(kTestUser, AuthError::INVALID_GAIA_CREDENTIALS);
wizard_->Step(SyncSetupWizard::GAIA_LOGIN);
EXPECT_TRUE(wizard_->IsVisible());
SyncSetupFlow::GetArgsForGaiaLogin(service_, &dialog_args);
@@ -371,8 +375,8 @@ TEST_F(SyncSetupWizardTest, DiscreteRun) {
EXPECT_EQ(kTestUser, actual_user);
int error = -1;
dialog_args.GetInteger(L"error", &error);
- EXPECT_EQ(static_cast<int>(AUTH_ERROR_INVALID_GAIA_CREDENTIALS), error);
- service_->set_auth_state(kTestUser, AUTH_ERROR_NONE);
+ EXPECT_EQ(static_cast<int>(AuthError::INVALID_GAIA_CREDENTIALS), error);
+ service_->set_auth_state(kTestUser, AuthError::NONE);
wizard_->Step(SyncSetupWizard::GAIA_SUCCESS);
EXPECT_TRUE(test_window_->TestAndResetWasShowHTMLDialogCalled());