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

Unified Diff: google_apis/gaia/gaia_auth_fetcher_unittest.cc

Issue 301323003: Remove GaiaAuthFetcher::StartCookieForOAuthCodeExchange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/gaia_auth_fetcher.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/gaia_auth_fetcher_unittest.cc
diff --git a/google_apis/gaia/gaia_auth_fetcher_unittest.cc b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
index 9d2f60aa5f05e384b8b3bcd3f021f584c126d032..af235dfd1b963c2f653207cdf92ce161845c4a03 100644
--- a/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -175,8 +175,6 @@ class MockGaiaConsumer : public GaiaAuthConsumer {
const std::string& token));
MOCK_METHOD1(OnClientOAuthSuccess,
void(const GaiaAuthConsumer::ClientOAuthResult& result));
- MOCK_METHOD1(OnClientOAuthCodeSuccess,
- void(const std::string& result));
MOCK_METHOD1(OnMergeSessionSuccess, void(const std::string& data));
MOCK_METHOD1(OnUberAuthTokenSuccess, void(const std::string& data));
MOCK_METHOD1(OnClientLoginFailure,
@@ -185,8 +183,6 @@ class MockGaiaConsumer : public GaiaAuthConsumer {
const GoogleServiceAuthError& error));
MOCK_METHOD1(OnClientOAuthFailure,
void(const GoogleServiceAuthError& error));
- MOCK_METHOD1(OnClientOAuthCodeFailure,
- void(const GoogleServiceAuthError& error));
MOCK_METHOD1(OnMergeSessionFailure, void(
const GoogleServiceAuthError& error));
MOCK_METHOD1(OnUberAuthTokenFailure, void(
@@ -632,54 +628,6 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenOAuth2TokenPairFailure) {
EXPECT_FALSE(auth.HasPendingFetch());
}
-TEST_F(GaiaAuthFetcherTest, OAuthCodeWithCookiesSuccess) {
- MockGaiaConsumer consumer;
- EXPECT_CALL(consumer, OnClientOAuthCodeSuccess("test-code")).Times(1);
-
- net::TestURLFetcherFactory factory;
- GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
- auth.StartCookieForOAuthCodeExchange("");
-
- net::TestURLFetcher* fetcher = factory.GetFetcherByID(0);
- EXPECT_TRUE(NULL != fetcher);
- EXPECT_EQ(net::LOAD_NORMAL, fetcher->GetLoadFlags());
- EXPECT_TRUE(auth.HasPendingFetch());
-
- net::ResponseCookies cookies;
- cookies.push_back(kGetAuthCodeValidCookie);
- MockFetcher mock_fetcher(
- client_login_to_oauth2_source_,
- net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_OK,
- cookies,
- std::string(),
- net::URLFetcher::POST,
- &auth);
- auth.OnURLFetchComplete(&mock_fetcher);
- EXPECT_FALSE(auth.HasPendingFetch());
-}
-
-TEST_F(GaiaAuthFetcherTest, OAuthCodeWithCookiesFailure) {
- MockGaiaConsumer consumer;
- EXPECT_CALL(consumer, OnClientOAuthCodeFailure(_)).Times(1);
-
- GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
- auth.StartCookieForOAuthCodeExchange("");
-
- EXPECT_TRUE(auth.HasPendingFetch());
- net::ResponseCookies cookies;
- MockFetcher mock_fetcher(
- client_login_to_oauth2_source_,
- net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_FORBIDDEN,
- cookies,
- std::string(),
- net::URLFetcher::POST,
- &auth);
- auth.OnURLFetchComplete(&mock_fetcher);
- EXPECT_FALSE(auth.HasPendingFetch());
-}
-
TEST_F(GaiaAuthFetcherTest, MergeSessionSuccess) {
MockGaiaConsumer consumer;
EXPECT_CALL(consumer, OnMergeSessionSuccess("<html></html>"))
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698