Index: chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc |
diff --git a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc |
index 47df6b7d7d7fe5db1ae98355dcb28dd880e52b3c..be42c583c08d071418c6a22d61546a9d2f25bc19 100644 |
--- a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc |
+++ b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc |
@@ -157,7 +157,7 @@ TEST_F(GaiaAuthFetcherTest, TokenNetFailure) { |
TEST_F(GaiaAuthFetcherTest, LoginDenied) { |
- std::string data("Error: NO!"); |
+ std::string data("Error=BadAuthentication"); |
URLRequestStatus status(URLRequestStatus::SUCCESS, 0); |
GoogleServiceAuthError expected_error( |
@@ -312,6 +312,22 @@ TEST_F(GaiaAuthFetcherTest, AccountDisabledError) { |
EXPECT_EQ(error.state(), GoogleServiceAuthError::ACCOUNT_DISABLED); |
} |
+TEST_F(GaiaAuthFetcherTest,BadAuthenticationError) { |
+ URLRequestStatus status(URLRequestStatus::SUCCESS, 0); |
+ std::string data = "Error=BadAuthentication\n"; |
+ GoogleServiceAuthError error = |
+ GaiaAuthFetcher::GenerateAuthError(data, status); |
+ EXPECT_EQ(error.state(), GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); |
+} |
+ |
+TEST_F(GaiaAuthFetcherTest,IncomprehensibleError) { |
+ URLRequestStatus status(URLRequestStatus::SUCCESS, 0); |
+ std::string data = "Error=Gobbledygook\n"; |
+ GoogleServiceAuthError error = |
+ GaiaAuthFetcher::GenerateAuthError(data, status); |
+ EXPECT_EQ(error.state(), GoogleServiceAuthError::SERVICE_UNAVAILABLE); |
+} |
+ |
TEST_F(GaiaAuthFetcherTest,ServiceUnavailableError) { |
URLRequestStatus status(URLRequestStatus::SUCCESS, 0); |
std::string data = "Error=ServiceUnavailable\n"; |