summaryrefslogtreecommitdiffstats
path: root/chrome/test/sync
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 02:53:55 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 02:53:55 +0000
commitf3d0174b68971b96dd2e8f518d81abee1fc87645 (patch)
treedc8b5e279042af86343784c90c2b85553a100ab9 /chrome/test/sync
parent92e83e01a65d77e69978360250979ddea41987ca (diff)
downloadchromium_src-f3d0174b68971b96dd2e8f518d81abee1fc87645.zip
chromium_src-f3d0174b68971b96dd2e8f518d81abee1fc87645.tar.gz
chromium_src-f3d0174b68971b96dd2e8f518d81abee1fc87645.tar.bz2
Moved GaiaAuthenticator from chrome/browser/sync/engine/net to chrome/common/net/gaia.
BUG=None TEST=None, no functional change. Review URL: http://codereview.chromium.org/1998004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/sync')
-rw-r--r--chrome/test/sync/engine/mock_gaia_authenticator.cc8
-rw-r--r--chrome/test/sync/engine/mock_gaia_authenticator.h12
-rw-r--r--chrome/test/sync/engine/mock_gaia_authenticator_unittest.cc10
3 files changed, 16 insertions, 14 deletions
diff --git a/chrome/test/sync/engine/mock_gaia_authenticator.cc b/chrome/test/sync/engine/mock_gaia_authenticator.cc
index 867da59..ebcf566 100644
--- a/chrome/test/sync/engine/mock_gaia_authenticator.cc
+++ b/chrome/test/sync/engine/mock_gaia_authenticator.cc
@@ -29,7 +29,8 @@ void MockGaiaAuthenticator::AddMockUser(MockUser mock_user) {
// A convenience method to add a mock user to internal list of users.
void MockGaiaAuthenticator::AddMockUser(string email, string passwd,
string auth_token, string lsid,
- string sid, enum AuthenticationError
+ string sid,
+ enum gaia::AuthenticationError
auth_error, string error_url,
string captcha_token,
string captcha_url) {
@@ -49,7 +50,8 @@ void MockGaiaAuthenticator::AddMockUser(string email, string passwd,
// A convenience method to add a mock user to internal list of users.
void MockGaiaAuthenticator::AddMockUser(string email, string passwd,
string auth_token, string lsid,
- string sid, enum AuthenticationError
+ string sid,
+ enum gaia::AuthenticationError
auth_error) {
MockUser mock_user;
mock_user.email = email;
@@ -96,7 +98,7 @@ bool MockGaiaAuthenticator::Authenticate(const char* email,
// Finding a user does not necessarily imply that the user was logged in OK.
// Therefore also check if the AuthenticationError is None.
- return (mock_credentials_[current_user_].auth_error == None);
+ return (mock_credentials_[current_user_].auth_error == gaia::None);
}
// Remove any stored knowledge about the currently logged-in user, but keep
diff --git a/chrome/test/sync/engine/mock_gaia_authenticator.h b/chrome/test/sync/engine/mock_gaia_authenticator.h
index 1968200..7eff11a 100644
--- a/chrome/test/sync/engine/mock_gaia_authenticator.h
+++ b/chrome/test/sync/engine/mock_gaia_authenticator.h
@@ -29,7 +29,7 @@
#include "base/port.h"
#include "base/basictypes.h"
-#include "chrome/browser/sync/engine/net/gaia_authenticator.h"
+#include "chrome/common/net/gaia/gaia_authenticator.h"
namespace browser_sync {
@@ -42,7 +42,7 @@ typedef struct {
std::string auth_token;
std::string sid;
std::string lsid;
- AuthenticationError auth_error;
+ gaia::AuthenticationError auth_error;
std::string captcha_token;
std::string captcha_url;
std::string error_url;
@@ -66,7 +66,7 @@ class MockGaiaAuthenticator {
void AddMockUser(std::string email, std::string passwd,
std::string auth_token,
std::string lsid, std::string sid,
- AuthenticationError auth_error,
+ gaia::AuthenticationError auth_error,
std::string error_url, std::string captcha_token,
std::string captcha_url);
@@ -76,7 +76,7 @@ class MockGaiaAuthenticator {
void AddMockUser(std::string email, std::string passwd,
std::string auth_token,
std::string lsid, std::string sid,
- enum AuthenticationError auth_error);
+ enum gaia::AuthenticationError auth_error);
// Removes a mock user from the current list of added users.
void RemoveMockUser(const char* email);
@@ -115,8 +115,8 @@ class MockGaiaAuthenticator {
mock_credentials_[current_user_].lsid;
}
- AuthenticationError auth_error() {
- return (current_user_.length() == 0) ? CredentialsNotSet :
+ gaia::AuthenticationError auth_error() {
+ return (current_user_.length() == 0) ? gaia::CredentialsNotSet :
mock_credentials_[current_user_].auth_error;
}
diff --git a/chrome/test/sync/engine/mock_gaia_authenticator_unittest.cc b/chrome/test/sync/engine/mock_gaia_authenticator_unittest.cc
index 76c08aa..cf0b994 100644
--- a/chrome/test/sync/engine/mock_gaia_authenticator_unittest.cc
+++ b/chrome/test/sync/engine/mock_gaia_authenticator_unittest.cc
@@ -6,8 +6,8 @@
#include "base/basictypes.h"
#include "base/port.h"
-#include "chrome/browser/sync/engine/net/gaia_authenticator.h"
#include "chrome/browser/sync/protocol/service_constants.h"
+#include "chrome/common/net/gaia/gaia_authenticator.h"
#include "chrome/test/sync/engine/mock_gaia_authenticator.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,7 +26,7 @@ TEST(MockGaiaAuthenticatorTest, TestAuthenticationSuccess) {
mock_user.auth_token = "SomeAuthToken";
mock_user.lsid = "SomeLSID";
mock_user.sid = "SomeSID";
- mock_user.auth_error = browser_sync::None;
+ mock_user.auth_error = gaia::None;
mock_gaia_auth.AddMockUser(mock_user);
// Assert away ...
@@ -63,7 +63,7 @@ TEST(MockGaiaAuthenticatorTest, TestRemoveMockUser) {
// Add our mock user
mock_gaia_auth.AddMockUser("test", "passwd", "SomeAuthToken", "SomeLSID",
- "SomeSID", browser_sync::None);
+ "SomeSID", gaia::None);
// Make sure authentication succeeds.
ASSERT_TRUE(mock_gaia_auth.Authenticate("test", "passwd"));
@@ -90,7 +90,7 @@ TEST(MockGaiaAuthenticatorTest, TestRemoveAllMockUsers) {
// Add our sample mock user.
mock_gaia_auth.AddMockUser("test", "passwd", "SomeAuthToken", "SomeLSID",
- "SomeSID", browser_sync::None);
+ "SomeSID", gaia::None);
// Make sure authentication succeeds
ASSERT_TRUE(mock_gaia_auth.Authenticate("test", "passwd"));
@@ -117,7 +117,7 @@ TEST(MockGaiaAuthenticatorTest, TestSavedCredentials) {
// Add our sample mock user.
mock_gaia_auth.AddMockUser("test", "passwd", "SomeAuthToken", "SomeLSID",
- "SomeSID", browser_sync::None);
+ "SomeSID", gaia::None);
// Ask to save credentials.
ASSERT_TRUE(mock_gaia_auth.Authenticate("test", "passwd", true));