summaryrefslogtreecommitdiffstats
path: root/chrome/common/net
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 23:44:05 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 23:44:05 +0000
commit8f2d8bddb95c01334a497ee5bff6f16ab02598d0 (patch)
treef9dab06b96c01a415a07e189c095121ca605e720 /chrome/common/net
parente2f963f190d976d507c2c56c34d0358121221a78 (diff)
downloadchromium_src-8f2d8bddb95c01334a497ee5bff6f16ab02598d0.zip
chromium_src-8f2d8bddb95c01334a497ee5bff6f16ab02598d0.tar.gz
chromium_src-8f2d8bddb95c01334a497ee5bff6f16ab02598d0.tar.bz2
Move test_url_fetcher_factory.* from content/ to net/url_request
Also mark URLFetcherImpl as NET_EXPORT_PRIVATE instead of NET_EXPORT, as it shouldn't be used except for some code in test_url_fetcher_factory.*. Update all references. BUG=118220 TEST= TBR=jam@chromium.org,jhawkins@chromium.org,mnissler@chromium.org Review URL: https://chromiumcodereview.appspot.com/10581012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143085 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/net')
-rw-r--r--chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc28
-rw-r--r--chrome/common/net/gaia/gaia_oauth_client_unittest.cc14
-rw-r--r--chrome/common/net/gaia/mock_url_fetcher_factory.h8
-rw-r--r--chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc4
-rw-r--r--chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc4
-rw-r--r--chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc4
-rw-r--r--chrome/common/net/gaia/oauth2_mint_token_flow_unittest.cc3
-rw-r--r--chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc6
8 files changed, 40 insertions, 31 deletions
diff --git a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc
index 10d8774..2229057 100644
--- a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc
+++ b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc
@@ -17,11 +17,11 @@
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/net/gaia/mock_url_fetcher_factory.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -531,7 +531,7 @@ TEST_F(GaiaAuthFetcherTest, ClientFetchPending) {
EXPECT_CALL(consumer, OnClientLoginSuccess(_))
.Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
@@ -557,7 +557,7 @@ TEST_F(GaiaAuthFetcherTest, FullTokenSuccess) {
EXPECT_CALL(consumer, OnIssueAuthTokenSuccess("service", "token"))
.Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
auth.StartIssueAuthToken("sid", "lsid", "service");
@@ -577,7 +577,7 @@ TEST_F(GaiaAuthFetcherTest, FullTokenFailure) {
EXPECT_CALL(consumer, OnIssueAuthTokenFailure("service", _))
.Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
@@ -597,11 +597,11 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenSuccess) {
EXPECT_CALL(consumer, OnClientOAuthSuccess(
GaiaAuthConsumer::ClientOAuthResult("rt1", "at1", 3600))).Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
auth.StartLsoForOAuthLoginTokenExchange("lso_token");
- TestURLFetcher* fetcher = factory.GetFetcherByID(0);
+ net::TestURLFetcher* fetcher = factory.GetFetcherByID(0);
EXPECT_TRUE(NULL != fetcher);
EXPECT_EQ(net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES,
fetcher->GetLoadFlags());
@@ -627,11 +627,11 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenSuccess) {
TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenWithCookies) {
MockGaiaConsumer consumer;
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
auth.StartCookieForOAuthLoginTokenExchange("0");
- TestURLFetcher* fetcher = factory.GetFetcherByID(0);
+ net::TestURLFetcher* fetcher = factory.GetFetcherByID(0);
EXPECT_TRUE(NULL != fetcher);
EXPECT_EQ(net::LOAD_NORMAL, fetcher->GetLoadFlags());
}
@@ -641,7 +641,7 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenClientLoginToOAuth2Failure) {
EXPECT_CALL(consumer, OnClientOAuthFailure(_))
.Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
auth.StartLsoForOAuthLoginTokenExchange("lso_token");
@@ -662,7 +662,7 @@ TEST_F(GaiaAuthFetcherTest, OAuthLoginTokenOAuth2TokenPairFailure) {
EXPECT_CALL(consumer, OnClientOAuthFailure(_))
.Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
auth.StartLsoForOAuthLoginTokenExchange("lso_token");
@@ -691,7 +691,7 @@ TEST_F(GaiaAuthFetcherTest, MergeSessionSuccess) {
EXPECT_CALL(consumer, OnMergeSessionSuccess("<html></html>"))
.Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
@@ -712,7 +712,7 @@ TEST_F(GaiaAuthFetcherTest, MergeSessionSuccessRedirect) {
EXPECT_CALL(consumer, OnMergeSessionSuccess("<html></html>"))
.Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
@@ -720,7 +720,7 @@ TEST_F(GaiaAuthFetcherTest, MergeSessionSuccessRedirect) {
// Make sure the fetcher created has the expected flags. Set its url()
// properties to reflect a redirect.
- TestURLFetcher* test_fetcher = factory.GetFetcherByID(0);
+ net::TestURLFetcher* test_fetcher = factory.GetFetcherByID(0);
EXPECT_TRUE(test_fetcher != NULL);
EXPECT_TRUE(test_fetcher->GetLoadFlags() == net::LOAD_NORMAL);
EXPECT_TRUE(auth.HasPendingFetch());
@@ -742,7 +742,7 @@ TEST_F(GaiaAuthFetcherTest, UberAuthTokenSuccess) {
EXPECT_CALL(consumer, OnUberAuthTokenSuccess("uberToken"))
.Times(1);
- TestURLFetcherFactory factory;
+ net::TestURLFetcherFactory factory;
GaiaAuthFetcher auth(&consumer, std::string(),
profile_.GetRequestContext());
diff --git a/chrome/common/net/gaia/gaia_oauth_client_unittest.cc b/chrome/common/net/gaia/gaia_oauth_client_unittest.cc
index fff67bf..df49161 100644
--- a/chrome/common/net/gaia/gaia_oauth_client_unittest.cc
+++ b/chrome/common/net/gaia/gaia_oauth_client_unittest.cc
@@ -11,10 +11,10 @@
#include "base/string_util.h"
#include "chrome/common/net/gaia/gaia_oauth_client.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -24,7 +24,7 @@ using ::testing::_;
namespace {
// Responds as though OAuth returned from the server.
-class MockOAuthFetcher : public TestURLFetcher {
+class MockOAuthFetcher : public net::TestURLFetcher {
public:
MockOAuthFetcher(int response_code,
int max_failure_count,
@@ -32,9 +32,9 @@ class MockOAuthFetcher : public TestURLFetcher {
const std::string& results,
net::URLFetcher::RequestType request_type,
net::URLFetcherDelegate* d)
- : TestURLFetcher(0, url, d),
- max_failure_count_(max_failure_count),
- current_failure_count_(0) {
+ : net::TestURLFetcher(0, url, d),
+ max_failure_count_(max_failure_count),
+ current_failure_count_(0) {
set_url(url);
set_response_code(response_code);
SetResponseString(results);
@@ -65,10 +65,10 @@ class MockOAuthFetcher : public TestURLFetcher {
};
class MockOAuthFetcherFactory : public net::URLFetcherFactory,
- public ScopedURLFetcherFactory {
+ public net::ScopedURLFetcherFactory {
public:
MockOAuthFetcherFactory()
- : ScopedURLFetcherFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
+ : net::ScopedURLFetcherFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
response_code_(net::HTTP_OK) {
}
~MockOAuthFetcherFactory() {}
diff --git a/chrome/common/net/gaia/mock_url_fetcher_factory.h b/chrome/common/net/gaia/mock_url_fetcher_factory.h
index e4ecf73..a3fb16c 100644
--- a/chrome/common/net/gaia/mock_url_fetcher_factory.h
+++ b/chrome/common/net/gaia/mock_url_fetcher_factory.h
@@ -12,11 +12,11 @@
#include <string>
#include "chrome/common/net/gaia/gaia_auth_fetcher.h"
-#include "content/public/test/test_url_fetcher_factory.h"
+#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_status.h"
// Responds as though ClientLogin returned from the server.
-class MockFetcher : public TestURLFetcher {
+class MockFetcher : public net::TestURLFetcher {
public:
MockFetcher(bool success,
const GURL& url,
@@ -42,10 +42,10 @@ class MockFetcher : public TestURLFetcher {
template<typename T>
class MockURLFetcherFactory : public net::URLFetcherFactory,
- public ScopedURLFetcherFactory {
+ public net::ScopedURLFetcherFactory {
public:
MockURLFetcherFactory()
- : ScopedURLFetcherFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
+ : net::ScopedURLFetcherFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
success_(true) {
}
~MockURLFetcherFactory() {}
diff --git a/chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc b/chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc
index b758e40..013f23c 100644
--- a/chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc
@@ -14,9 +14,9 @@
#include "chrome/common/net/gaia/oauth2_access_token_fetcher.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/test_browser_thread.h"
-#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_factory.h"
@@ -27,6 +27,8 @@
using content::BrowserThread;
using net::ResponseCookies;
+using net::ScopedURLFetcherFactory;
+using net::TestURLFetcher;
using net::URLFetcher;
using net::URLFetcherDelegate;
using net::URLFetcherFactory;
diff --git a/chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc b/chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc
index ca87e79..5df058a 100644
--- a/chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc
@@ -14,9 +14,9 @@
#include "chrome/common/net/gaia/oauth2_access_token_fetcher.h"
#include "chrome/common/net/gaia/oauth2_api_call_flow.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/public/test/test_url_fetcher_factory.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_factory.h"
@@ -26,6 +26,8 @@
#include "testing/gtest/include/gtest/gtest.h"
using net::HttpRequestHeaders;
+using net::ScopedURLFetcherFactory;
+using net::TestURLFetcher;
using net::URLFetcher;
using net::URLFetcherDelegate;
using net::URLFetcherFactory;
diff --git a/chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc b/chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc
index 3fe0c66..015bb99 100644
--- a/chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc
@@ -15,9 +15,9 @@
#include "chrome/common/net/gaia/oauth2_mint_token_fetcher.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/test_browser_thread.h"
-#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_factory.h"
@@ -28,6 +28,8 @@
using content::BrowserThread;
using net::ResponseCookies;
+using net::ScopedURLFetcherFactory;
+using net::TestURLFetcher;
using net::URLFetcher;
using net::URLFetcherDelegate;
using net::URLFetcherFactory;
diff --git a/chrome/common/net/gaia/oauth2_mint_token_flow_unittest.cc b/chrome/common/net/gaia/oauth2_mint_token_flow_unittest.cc
index 1c897e8..77213cd 100644
--- a/chrome/common/net/gaia/oauth2_mint_token_flow_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_mint_token_flow_unittest.cc
@@ -12,11 +12,12 @@
#include "base/values.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/net/gaia/oauth2_mint_token_flow.h"
-#include "content/public/test/test_url_fetcher_factory.h"
+#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_status.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+using net::TestURLFetcher;
using net::URLFetcher;
using net::URLRequestStatus;
using testing::_;
diff --git a/chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc b/chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc
index aec0c82..bba6375 100644
--- a/chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc
@@ -14,9 +14,9 @@
#include "chrome/common/net/gaia/oauth2_revocation_fetcher.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/test_browser_thread.h"
-#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_factory.h"
@@ -26,10 +26,12 @@
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
+using net::ResponseCookies;
+using net::ScopedURLFetcherFactory;
+using net::TestURLFetcher;
using net::URLFetcher;
using net::URLFetcherDelegate;
using net::URLFetcherFactory;
-using net::ResponseCookies;
using net::URLRequestStatus;
using testing::_;
using testing::Return;