diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 02:12:44 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 02:12:44 +0000 |
commit | f90bf0d9264f7f272b7f4a65f864cb7170417fe8 (patch) | |
tree | 3df23eb7b118bfd40c7601df6245d869b56ced49 /chrome/common/net/gaia | |
parent | 56d8cf25ee047078688c8af5917fcfbc63ac749b (diff) | |
download | chromium_src-f90bf0d9264f7f272b7f4a65f864cb7170417fe8.zip chromium_src-f90bf0d9264f7f272b7f4a65f864cb7170417fe8.tar.gz chromium_src-f90bf0d9264f7f272b7f4a65f864cb7170417fe8.tar.bz2 |
net: Remove typedef net::URLRequestStatus URLRequestStatus;
BUG=64263
TEST=compiled locally, trybots
Review URL: http://codereview.chromium.org/6166010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/net/gaia')
-rw-r--r-- | chrome/common/net/gaia/gaia_auth_fetcher.cc | 14 | ||||
-rw-r--r-- | chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc | 65 | ||||
-rw-r--r-- | chrome/common/net/gaia/gaia_auth_fetcher_unittest.h | 10 |
3 files changed, 46 insertions, 43 deletions
diff --git a/chrome/common/net/gaia/gaia_auth_fetcher.cc b/chrome/common/net/gaia/gaia_auth_fetcher.cc index 0da33ca..520c135 100644 --- a/chrome/common/net/gaia/gaia_auth_fetcher.cc +++ b/chrome/common/net/gaia/gaia_auth_fetcher.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -314,10 +314,10 @@ void GaiaAuthFetcher::StartGetUserInfo(const std::string& lsid, // static GoogleServiceAuthError GaiaAuthFetcher::GenerateAuthError( const std::string& data, - const URLRequestStatus& status) { + const net::URLRequestStatus& status) { if (!status.is_success()) { - if (status.status() == URLRequestStatus::CANCELED) { + if (status.status() == net::URLRequestStatus::CANCELED) { return GoogleServiceAuthError(GoogleServiceAuthError::REQUEST_CANCELED); } else { LOG(WARNING) << "Could not reach Google Accounts servers: errno " @@ -365,7 +365,7 @@ GoogleServiceAuthError GaiaAuthFetcher::GenerateAuthError( } void GaiaAuthFetcher::OnClientLoginFetched(const std::string& data, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code) { if (status.is_success() && response_code == RC_REQUEST_OK) { @@ -383,7 +383,7 @@ void GaiaAuthFetcher::OnClientLoginFetched(const std::string& data, void GaiaAuthFetcher::OnIssueAuthTokenFetched( const std::string& data, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code) { if (status.is_success() && response_code == RC_REQUEST_OK) { // Only the bare token is returned in the body of this Gaia call @@ -397,7 +397,7 @@ void GaiaAuthFetcher::OnIssueAuthTokenFetched( void GaiaAuthFetcher::OnGetUserInfoFetched( const std::string& data, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code) { using std::vector; using std::string; @@ -421,7 +421,7 @@ void GaiaAuthFetcher::OnGetUserInfoFetched( void GaiaAuthFetcher::OnURLFetchComplete(const URLFetcher* source, const GURL& url, - const URLRequestStatus& status, + const net::URLRequestStatus& status, int response_code, const ResponseCookies& cookies, const std::string& data) { diff --git a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc index c7814c9..0830766 100644 --- a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc +++ b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -115,7 +115,7 @@ TEST_F(GaiaAuthFetcherTest, ErrorComparator) { TEST_F(GaiaAuthFetcherTest, LoginNetFailure) { int error_no = net::ERR_CONNECTION_RESET; - URLRequestStatus status(URLRequestStatus::FAILED, error_no); + net::URLRequestStatus status(net::URLRequestStatus::FAILED, error_no); GoogleServiceAuthError expected_error = GoogleServiceAuthError::FromConnectionError(error_no); @@ -137,7 +137,7 @@ TEST_F(GaiaAuthFetcherTest, LoginNetFailure) { TEST_F(GaiaAuthFetcherTest, TokenNetFailure) { int error_no = net::ERR_CONNECTION_RESET; - URLRequestStatus status(URLRequestStatus::FAILED, error_no); + net::URLRequestStatus status(net::URLRequestStatus::FAILED, error_no); GoogleServiceAuthError expected_error = GoogleServiceAuthError::FromConnectionError(error_no); @@ -160,7 +160,7 @@ TEST_F(GaiaAuthFetcherTest, TokenNetFailure) { TEST_F(GaiaAuthFetcherTest, LoginDenied) { std::string data("Error=BadAuthentication"); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); GoogleServiceAuthError expected_error( GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); @@ -220,7 +220,7 @@ TEST_F(GaiaAuthFetcherTest, OnlineLogin) { GaiaAuthFetcher auth(&consumer, std::string(), profile_.GetRequestContext()); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); auth.OnURLFetchComplete(NULL, client_login_source_, status, @@ -236,7 +236,7 @@ TEST_F(GaiaAuthFetcherTest, WorkingIssueAuthToken) { GaiaAuthFetcher auth(&consumer, std::string(), profile_.GetRequestContext()); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); auth.OnURLFetchComplete(NULL, issue_auth_token_source_, status, @@ -270,7 +270,7 @@ TEST_F(GaiaAuthFetcherTest, TwoFactorLogin) { GaiaAuthFetcher auth(&consumer, std::string(), profile_.GetRequestContext()); - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); auth.OnURLFetchComplete(NULL, client_login_source_, status, @@ -280,7 +280,7 @@ TEST_F(GaiaAuthFetcherTest, TwoFactorLogin) { } TEST_F(GaiaAuthFetcherTest, CaptchaParse) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Url=http://www.google.com/login/captcha\n" "Error=CaptchaRequired\n" "CaptchaToken=CCTOKEN\n" @@ -299,7 +299,7 @@ TEST_F(GaiaAuthFetcherTest, CaptchaParse) { } TEST_F(GaiaAuthFetcherTest, AccountDeletedError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=AccountDeleted\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -307,7 +307,7 @@ TEST_F(GaiaAuthFetcherTest, AccountDeletedError) { } TEST_F(GaiaAuthFetcherTest, AccountDisabledError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=AccountDisabled\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -315,7 +315,7 @@ TEST_F(GaiaAuthFetcherTest, AccountDisabledError) { } TEST_F(GaiaAuthFetcherTest,BadAuthenticationError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=BadAuthentication\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -323,7 +323,7 @@ TEST_F(GaiaAuthFetcherTest,BadAuthenticationError) { } TEST_F(GaiaAuthFetcherTest,IncomprehensibleError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=Gobbledygook\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -331,7 +331,7 @@ TEST_F(GaiaAuthFetcherTest,IncomprehensibleError) { } TEST_F(GaiaAuthFetcherTest,ServiceUnavailableError) { - URLRequestStatus status(URLRequestStatus::SUCCESS, 0); + net::URLRequestStatus status(net::URLRequestStatus::SUCCESS, 0); std::string data = "Error=ServiceUnavailable\n"; GoogleServiceAuthError error = GaiaAuthFetcher::GenerateAuthError(data, status); @@ -403,12 +403,13 @@ TEST_F(GaiaAuthFetcherTest, ClientFetchPending) { URLFetcher::set_factory(NULL); EXPECT_TRUE(auth.HasPendingFetch()); - auth.OnURLFetchComplete(NULL, - client_login_source_, - URLRequestStatus(URLRequestStatus::SUCCESS, 0), - RC_REQUEST_OK, - cookies_, - "SID=sid\nLSID=lsid\nAuth=auth\n"); + auth.OnURLFetchComplete( + NULL, + client_login_source_, + net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), + RC_REQUEST_OK, + cookies_, + "SID=sid\nLSID=lsid\nAuth=auth\n"); EXPECT_FALSE(auth.HasPendingFetch()); } @@ -427,12 +428,13 @@ TEST_F(GaiaAuthFetcherTest, FullTokenSuccess) { URLFetcher::set_factory(NULL); EXPECT_TRUE(auth.HasPendingFetch()); - auth.OnURLFetchComplete(NULL, - issue_auth_token_source_, - URLRequestStatus(URLRequestStatus::SUCCESS, 0), - RC_REQUEST_OK, - cookies_, - "token"); + auth.OnURLFetchComplete( + NULL, + issue_auth_token_source_, + net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), + RC_REQUEST_OK, + cookies_, + "token"); EXPECT_FALSE(auth.HasPendingFetch()); } @@ -451,11 +453,12 @@ TEST_F(GaiaAuthFetcherTest, FullTokenFailure) { URLFetcher::set_factory(NULL); EXPECT_TRUE(auth.HasPendingFetch()); - auth.OnURLFetchComplete(NULL, - issue_auth_token_source_, - URLRequestStatus(URLRequestStatus::SUCCESS, 0), - RC_FORBIDDEN, - cookies_, - ""); + auth.OnURLFetchComplete( + NULL, + issue_auth_token_source_, + net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0), + RC_FORBIDDEN, + cookies_, + ""); EXPECT_FALSE(auth.HasPendingFetch()); } diff --git a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h index 4676a26..65235b1 100644 --- a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h +++ b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -32,17 +32,17 @@ class MockFetcher : public URLFetcher { ~MockFetcher() {} void Start() { - URLRequestStatus::Status code; + net::URLRequestStatus::Status code; int http_code; if (success_) { http_code = RC_REQUEST_OK; - code = URLRequestStatus::SUCCESS; + code = net::URLRequestStatus::SUCCESS; } else { http_code = RC_FORBIDDEN; - code = URLRequestStatus::FAILED; + code = net::URLRequestStatus::FAILED; } - URLRequestStatus status(code, 0); + net::URLRequestStatus status(code, 0); delegate()->OnURLFetchComplete(NULL, url_, status, |