Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: google_apis/gaia/google_service_auth_error_unittest.cc

Issue 14169010: Remove support for ClientOAuth from GaiaAuthFetcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « google_apis/gaia/google_service_auth_error.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/google_service_auth_error_unittest.cc
diff --git a/google_apis/gaia/google_service_auth_error_unittest.cc b/google_apis/gaia/google_service_auth_error_unittest.cc
index 15155b64e945a15259c9b3ae555d28da79a68e0d..d1f920ab9c20edb8785f581345c7e60b845bdc0a 100644
--- a/google_apis/gaia/google_service_auth_error_unittest.cc
+++ b/google_apis/gaia/google_service_auth_error_unittest.cc
@@ -52,73 +52,4 @@ TEST_F(GoogleServiceAuthErrorTest, ConnectionFailed) {
ExpectDictStringValue("net::OK", *value, "networkError");
}
-TEST_F(GoogleServiceAuthErrorTest, CaptchaChallenge) {
- GoogleServiceAuthError error(
- GoogleServiceAuthError::FromClientLoginCaptchaChallenge(
- "captcha_token", GURL("http://www.google.com"),
- GURL("http://www.bing.com")));
- scoped_ptr<DictionaryValue> value(error.ToValue());
- EXPECT_EQ(2u, value->size());
- ExpectDictStringValue("CAPTCHA_REQUIRED", *value, "state");
- DictionaryValue* captcha_value = NULL;
- EXPECT_TRUE(value->GetDictionary("captcha", &captcha_value));
- ASSERT_TRUE(captcha_value);
- ExpectDictStringValue("captcha_token", *captcha_value, "token");
- ExpectDictStringValue(std::string(), *captcha_value, "audioUrl");
- ExpectDictStringValue("http://www.google.com/", *captcha_value, "imageUrl");
- ExpectDictStringValue("http://www.bing.com/", *captcha_value, "unlockUrl");
- ExpectDictIntegerValue(0, *captcha_value, "imageWidth");
- ExpectDictIntegerValue(0, *captcha_value, "imageHeight");
-}
-
-TEST_F(GoogleServiceAuthErrorTest, CaptchaChallenge2) {
- GoogleServiceAuthError error(
- GoogleServiceAuthError::FromCaptchaChallenge(
- "captcha_token", GURL("http://www.audio.com"),
- GURL("http://www.image.com"), 320, 200));
- scoped_ptr<DictionaryValue> value(error.ToValue());
- EXPECT_EQ(2u, value->size());
- ExpectDictStringValue("CAPTCHA_REQUIRED", *value, "state");
- DictionaryValue* captcha_value = NULL;
- EXPECT_TRUE(value->GetDictionary("captcha", &captcha_value));
- ASSERT_TRUE(captcha_value);
- ExpectDictStringValue("captcha_token", *captcha_value, "token");
- ExpectDictStringValue("http://www.audio.com/", *captcha_value, "audioUrl");
- ExpectDictStringValue("http://www.image.com/", *captcha_value, "imageUrl");
- ExpectDictIntegerValue(320, *captcha_value, "imageWidth");
- ExpectDictIntegerValue(200, *captcha_value, "imageHeight");
-}
-
-TEST_F(GoogleServiceAuthErrorTest, TwoFactorChallenge) {
- GoogleServiceAuthError error(
- GoogleServiceAuthError::FromSecondFactorChallenge(
- "two_factor_token", "prompt_text", "alternate_text", 10));
- scoped_ptr<DictionaryValue> value(error.ToValue());
- EXPECT_EQ(2u, value->size());
- ExpectDictStringValue("TWO_FACTOR", *value, "state");
- DictionaryValue* two_factor_value = NULL;
- EXPECT_TRUE(value->GetDictionary("two_factor", &two_factor_value));
- ASSERT_TRUE(two_factor_value);
- ExpectDictStringValue("two_factor_token", *two_factor_value, "token");
- ExpectDictStringValue("prompt_text", *two_factor_value, "promptText");
- ExpectDictStringValue("alternate_text", *two_factor_value, "alternateText");
- ExpectDictIntegerValue(10, *two_factor_value, "fieldLength");
-}
-
-TEST_F(GoogleServiceAuthErrorTest, ClientOAuthError) {
- // Test that a malformed/incomplete ClientOAuth response generates
- // a connection problem error.
- GoogleServiceAuthError error1(
- GoogleServiceAuthError::FromClientOAuthError("{}"));
- EXPECT_EQ(GoogleServiceAuthError::CONNECTION_FAILED, error1.state());
-
- // Test that a well formed ClientOAuth response generates an invalid
- // credentials error with the given error message.
- GoogleServiceAuthError error2(
- GoogleServiceAuthError::FromClientOAuthError(
- "{\"cause\":\"foo\",\"explanation\":\"error_message\"}"));
- EXPECT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, error2.state());
- EXPECT_EQ("error_message", error2.error_message());
-}
-
} // namespace
« no previous file with comments | « google_apis/gaia/google_service_auth_error.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698