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

Unified Diff: google_apis/gaia/gaia_auth_fetcher_unittest.cc

Issue 2872253002: Network traffic annotation added to gaia_auth_fetcher. (Closed)
Patch Set: Comments addressed. Created 3 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') | ios/chrome/browser/signin/gaia_auth_fetcher_ios.h » ('j') | 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 450761a07ba9a598530a6df8691d148207bb80fc..2311cc3c84e82ce66ae3a7400fb465e72a94f70a 100644
--- a/google_apis/gaia/gaia_auth_fetcher_unittest.cc
+++ b/google_apis/gaia/gaia_auth_fetcher_unittest.cc
@@ -354,46 +354,6 @@ TEST_F(GaiaAuthFetcherTest, ServiceUnavailableError) {
EXPECT_EQ(error.state(), GoogleServiceAuthError::SERVICE_UNAVAILABLE);
}
-TEST_F(GaiaAuthFetcherTest, FullTokenSuccess) {
- MockGaiaConsumer consumer;
- EXPECT_CALL(consumer, OnIssueAuthTokenSuccess("service", "token"))
- .Times(1);
-
- net::TestURLFetcherFactory factory;
- GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
- auth.StartIssueAuthToken("sid", "lsid", "service");
-
- EXPECT_TRUE(auth.HasPendingFetch());
- MockFetcher mock_fetcher(
- issue_auth_token_source_,
- net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), net::HTTP_OK,
- "token", net::URLFetcher::GET, &auth);
- auth.OnURLFetchComplete(&mock_fetcher);
- EXPECT_FALSE(auth.HasPendingFetch());
-}
-
-TEST_F(GaiaAuthFetcherTest, FullTokenFailure) {
- MockGaiaConsumer consumer;
- EXPECT_CALL(consumer, OnIssueAuthTokenFailure("service", _))
- .Times(1);
-
- net::TestURLFetcherFactory factory;
-
- GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
- auth.StartIssueAuthToken("sid", "lsid", "service");
-
- EXPECT_TRUE(auth.HasPendingFetch());
- MockFetcher mock_fetcher(
- issue_auth_token_source_,
- net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0),
- net::HTTP_FORBIDDEN,
- std::string(),
- net::URLFetcher::GET,
- &auth);
- auth.OnURLFetchComplete(&mock_fetcher);
- EXPECT_FALSE(auth.HasPendingFetch());
-}
-
TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenSuccess) {
MockGaiaConsumer consumer;
EXPECT_CALL(consumer, OnClientOAuthCode("test-code")).Times(0);
@@ -723,35 +683,3 @@ TEST_F(GaiaAuthFetcherTest, GetCheckConnectionInfo) {
status, net::HTTP_OK, data, net::URLFetcher::GET, &auth);
auth.OnURLFetchComplete(&mock_fetcher);
}
-
-TEST_F(GaiaAuthFetcherTest, ListIDPSessions) {
- std::string data("{\"sessions\":[{\"login_hint\":\"abcdefghijklmnop\"}]}");
- MockGaiaConsumer consumer;
- EXPECT_CALL(consumer, OnListIdpSessionsSuccess("abcdefghijklmnop")).Times(1);
-
- GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
- auth.StartListIDPSessions(std::string(), std::string());
-
- net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
- MockFetcher mock_fetcher(GaiaUrls::GetInstance()->oauth2_iframe_url(), status,
- net::HTTP_OK, data, net::URLFetcher::GET, &auth);
- auth.OnURLFetchComplete(&mock_fetcher);
-}
-
-TEST_F(GaiaAuthFetcherTest, GetTokenResponse) {
- MockGaiaConsumer consumer;
- EXPECT_CALL(consumer,
- OnGetTokenResponseSuccess(
- GaiaAuthConsumer::ClientOAuthResult(std::string(),
- "at1",
- 3600))).Times(1);
-
- GaiaAuthFetcher auth(&consumer, std::string(), GetRequestContext());
- auth.StartGetTokenResponse(std::string(), std::string(), std::string());
-
- net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0);
- MockFetcher mock_fetcher(GaiaUrls::GetInstance()->oauth2_iframe_url(), status,
- net::HTTP_OK, kGetTokenPairValidResponse,
- net::URLFetcher::GET, &auth);
- auth.OnURLFetchComplete(&mock_fetcher);
-}
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.cc ('k') | ios/chrome/browser/signin/gaia_auth_fetcher_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698