| Index: chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc
|
| ===================================================================
|
| --- chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc (revision 68762)
|
| +++ chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc (working copy)
|
| @@ -159,7 +159,7 @@
|
|
|
|
|
| TEST_F(GaiaAuthFetcherTest, LoginDenied) {
|
| - std::string data("Error: NO!");
|
| + std::string data("Error=BadAuthentication");
|
| URLRequestStatus status(URLRequestStatus::SUCCESS, 0);
|
|
|
| GoogleServiceAuthError expected_error(
|
| @@ -314,6 +314,22 @@
|
| 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";
|
|
|