summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autofill/autofill_download_unittest.cc3
-rw-r--r--chrome/browser/component_updater/component_updater_service_unittest.cc7
-rw-r--r--chrome/browser/intents/cws_intents_registry_unittest.cc14
-rw-r--r--chrome/browser/net/http_pipelining_compatibility_client_unittest.cc12
-rw-r--r--chrome/browser/safe_browsing/malware_details_unittest.cc1
-rw-r--r--chrome/browser/sync/glue/http_bridge_unittest.cc14
-rw-r--r--chrome/browser/sync/glue/sync_backend_host_unittest.cc2
-rw-r--r--chrome/browser/sync/notifier/DEPS2
-rw-r--r--chrome/browser/sync/notifier/invalidation_notifier_unittest.cc5
-rw-r--r--chrome/browser/sync/notifier/non_blocking_invalidation_notifier_unittest.cc6
-rw-r--r--chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc6
-rw-r--r--chrome/browser/sync/tools/sync_listen_notifications.cc5
-rw-r--r--chrome/browser/sync/tools/sync_tools.gyp1
-rw-r--r--chrome/chrome_tests.gypi4
-rw-r--r--chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc26
-rw-r--r--chrome/test/base/test_url_request_context_getter.cc25
-rw-r--r--chrome/test/base/test_url_request_context_getter.h35
-rw-r--r--chrome/test/base/testing_profile.cc5
18 files changed, 54 insertions, 119 deletions
diff --git a/chrome/browser/autofill/autofill_download_unittest.cc b/chrome/browser/autofill/autofill_download_unittest.cc
index dab40ce..c4f26cf 100644
--- a/chrome/browser/autofill/autofill_download_unittest.cc
+++ b/chrome/browser/autofill/autofill_download_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -13,7 +13,6 @@
#include "chrome/browser/autofill/autofill_metrics.h"
#include "chrome/browser/autofill/autofill_type.h"
#include "chrome/browser/autofill/form_structure.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "content/test/test_browser_thread.h"
diff --git a/chrome/browser/component_updater/component_updater_service_unittest.cc b/chrome/browser/component_updater/component_updater_service_unittest.cc
index 89fce47..fd38931 100644
--- a/chrome/browser/component_updater/component_updater_service_unittest.cc
+++ b/chrome/browser/component_updater/component_updater_service_unittest.cc
@@ -14,16 +14,14 @@
#include "chrome/browser/component_updater/component_updater_interceptor.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
#include "content/test/test_browser_thread.h"
#include "content/public/common/url_fetcher.h"
#include "content/test/test_notification_tracker.h"
-
#include "googleurl/src/gurl.h"
#include "libxml/globals.h"
-
+#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
@@ -65,7 +63,8 @@ class TestConfigurator : public ComponentUpdateService::Configurator {
virtual size_t UrlSizeLimit() OVERRIDE { return 256; }
virtual net::URLRequestContextGetter* RequestContext() OVERRIDE {
- return new TestURLRequestContextGetter();
+ return new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
}
// Don't use the utility process to decode files.
diff --git a/chrome/browser/intents/cws_intents_registry_unittest.cc b/chrome/browser/intents/cws_intents_registry_unittest.cc
index dcd0e0b..2c258f5 100644
--- a/chrome/browser/intents/cws_intents_registry_unittest.cc
+++ b/chrome/browser/intents/cws_intents_registry_unittest.cc
@@ -8,8 +8,8 @@
#include "base/bind_helpers.h"
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/test/test_url_fetcher_factory.h"
+#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -91,17 +91,18 @@ class CWSIntentsRegistryTest : public testing::Test {
CWSIntentsRegistry::IntentExtensionList extensions_;
FakeURLFetcherFactory test_factory_;
- private:
+ protected:
MessageLoop ui_loop_;
};
} // namespace
TEST_F(CWSIntentsRegistryTest, ValidQuery) {
- TestURLRequestContextGetter context_getter;
+ const scoped_refptr<TestURLRequestContextGetter> context_getter(
+ new TestURLRequestContextGetter(ui_loop_.message_loop_proxy()));
test_factory_.SetFakeResponse(kCWSQueryValid, kCWSResponseValid, true);
- CWSIntentsRegistry registry(&context_getter);
+ CWSIntentsRegistry registry(context_getter);
registry.GetIntentServices(ASCIIToUTF16("http://webintents.org/edit"),
ASCIIToUTF16("*/png"),
base::Bind(&CWSIntentsRegistryTest::Callback,
@@ -117,10 +118,11 @@ TEST_F(CWSIntentsRegistryTest, ValidQuery) {
}
TEST_F(CWSIntentsRegistryTest, InvalidQuery) {
- TestURLRequestContextGetter context_getter;
+ const scoped_refptr<TestURLRequestContextGetter> context_getter(
+ new TestURLRequestContextGetter(ui_loop_.message_loop_proxy()));
test_factory_.SetFakeResponse(kCWSQueryInvalid, kCWSResponseInvalid, true);
- CWSIntentsRegistry registry(&context_getter);
+ CWSIntentsRegistry registry(context_getter);
registry.GetIntentServices(ASCIIToUTF16("foo"),
ASCIIToUTF16("foo"),
base::Bind(&CWSIntentsRegistryTest::Callback,
diff --git a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
index 91608c7..0585795 100644
--- a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
+++ b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
@@ -13,11 +13,11 @@
#include "base/metrics/histogram.h"
#include "base/stl_util.h"
#include "base/stringprintf.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/test/test_browser_thread.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/url_request/url_request_context_getter.h"
+#include "net/url_request/url_request_test_util.h"
#include "net/test/test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -43,6 +43,8 @@ enum HistogramField {
FIELD_STATUS,
};
+using content::BrowserThread;
+
class HttpPipeliningCompatibilityClientTest : public testing::Test {
public:
HttpPipeliningCompatibilityClientTest()
@@ -50,13 +52,14 @@ class HttpPipeliningCompatibilityClientTest : public testing::Test {
net::TestServer::TYPE_HTTP,
net::TestServer::kLocalhost,
FilePath(FILE_PATH_LITERAL("chrome/test/data/http_pipelining"))),
- io_thread_(content::BrowserThread::IO, &message_loop_) {
+ io_thread_(BrowserThread::IO, &message_loop_) {
}
protected:
virtual void SetUp() OVERRIDE {
ASSERT_TRUE(test_server_.Start());
- context_ = new TestURLRequestContextGetter;
+ context_ = new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
context_->AddRef();
for (size_t i = 0; i < arraysize(kHistogramNames); ++i) {
@@ -69,8 +72,7 @@ class HttpPipeliningCompatibilityClientTest : public testing::Test {
}
virtual void TearDown() OVERRIDE {
- content::BrowserThread::ReleaseSoon(content::BrowserThread::IO,
- FROM_HERE, context_);
+ BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, context_);
message_loop_.RunAllPending();
}
diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc
index cb665f6..dfe3b64 100644
--- a/chrome/browser/safe_browsing/malware_details_unittest.cc
+++ b/chrome/browser/safe_browsing/malware_details_unittest.cc
@@ -16,7 +16,6 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "chrome/test/base/testing_profile.h"
#include "content/browser/tab_contents/test_tab_contents.h"
#include "content/test/test_browser_thread.h"
diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc
index 1fd9092..5329819 100644
--- a/chrome/browser/sync/glue/http_bridge_unittest.cc
+++ b/chrome/browser/sync/glue/http_bridge_unittest.cc
@@ -5,7 +5,6 @@
#include "base/message_loop_proxy.h"
#include "base/threading/thread.h"
#include "chrome/browser/sync/glue/http_bridge.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/test/test_browser_thread.h"
#include "content/test/test_url_fetcher_factory.h"
#include "net/test/test_server.h"
@@ -45,7 +44,9 @@ class SyncHttpBridgeTest : public testing::Test {
HttpBridge* BuildBridge() {
if (!fake_default_request_context_getter_) {
- fake_default_request_context_getter_ = new TestURLRequestContextGetter();
+ fake_default_request_context_getter_ =
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
fake_default_request_context_getter_->AddRef();
}
HttpBridge* bridge = new HttpBridge(
@@ -148,7 +149,8 @@ TEST_F(SyncHttpBridgeTest, TestUsesSameHttpNetworkSession) {
// Test the HttpBridge without actually making any network requests.
TEST_F(SyncHttpBridgeTest, TestMakeSynchronousPostShunted) {
scoped_refptr<net::URLRequestContextGetter> ctx_getter(
- new TestURLRequestContextGetter());
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
scoped_refptr<HttpBridge> http_bridge(new ShuntedHttpBridge(
ctx_getter, this, false));
http_bridge->SetUserAgent("bob");
@@ -272,7 +274,8 @@ TEST_F(SyncHttpBridgeTest, TestResponseHeader) {
TEST_F(SyncHttpBridgeTest, Abort) {
scoped_refptr<net::URLRequestContextGetter> ctx_getter(
- new TestURLRequestContextGetter());
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
scoped_refptr<ShuntedHttpBridge> http_bridge(new ShuntedHttpBridge(
ctx_getter, this, true));
http_bridge->SetUserAgent("bob");
@@ -291,7 +294,8 @@ TEST_F(SyncHttpBridgeTest, Abort) {
TEST_F(SyncHttpBridgeTest, AbortLate) {
scoped_refptr<net::URLRequestContextGetter> ctx_getter(
- new TestURLRequestContextGetter());
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
scoped_refptr<ShuntedHttpBridge> http_bridge(new ShuntedHttpBridge(
ctx_getter, this, false));
http_bridge->SetUserAgent("bob");
diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
index 2a700ec..04e1807 100644
--- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
@@ -14,9 +14,7 @@
#include "chrome/browser/sync/protocol/sync_protocol_error.h"
#include "chrome/browser/sync/sync_prefs.h"
#include "chrome/browser/sync/syncable/model_type.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "chrome/test/base/testing_profile.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/test/test_browser_thread.h"
#include "content/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/sync/notifier/DEPS b/chrome/browser/sync/notifier/DEPS
index 19b4f38..7376cba 100644
--- a/chrome/browser/sync/notifier/DEPS
+++ b/chrome/browser/sync/notifier/DEPS
@@ -1,8 +1,6 @@
include_rules = [
"-chrome",
- "+chrome/test/base",
-
"+chrome/browser/sync/notifier",
"+chrome/browser/sync/syncable/model_type.h",
"+chrome/browser/sync/syncable/model_type_payload_map.h",
diff --git a/chrome/browser/sync/notifier/invalidation_notifier_unittest.cc b/chrome/browser/sync/notifier/invalidation_notifier_unittest.cc
index 93b123a..64f206c 100644
--- a/chrome/browser/sync/notifier/invalidation_notifier_unittest.cc
+++ b/chrome/browser/sync/notifier/invalidation_notifier_unittest.cc
@@ -11,12 +11,12 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/syncable/model_type_payload_map.h"
#include "chrome/browser/sync/util/weak_handle.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/test/test_browser_thread.h"
#include "jingle/notifier/base/fake_base_task.h"
#include "jingle/notifier/base/notifier_options.h"
#include "net/base/cert_verifier.h"
#include "net/base/host_resolver.h"
+#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -37,7 +37,8 @@ class InvalidationNotifierTest : public testing::Test {
notifier::NotifierOptions notifier_options;
// Note: URLRequestContextGetters are ref-counted.
notifier_options.request_context_getter =
- new TestURLRequestContextGetter();
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
invalidation_notifier_.reset(
new InvalidationNotifier(
notifier_options,
diff --git a/chrome/browser/sync/notifier/non_blocking_invalidation_notifier_unittest.cc b/chrome/browser/sync/notifier/non_blocking_invalidation_notifier_unittest.cc
index c293bdb..a3b8f64 100644
--- a/chrome/browser/sync/notifier/non_blocking_invalidation_notifier_unittest.cc
+++ b/chrome/browser/sync/notifier/non_blocking_invalidation_notifier_unittest.cc
@@ -13,9 +13,9 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/syncable/model_type_payload_map.h"
#include "chrome/browser/sync/util/weak_handle.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/test/test_browser_thread.h"
#include "jingle/notifier/base/fake_base_task.h"
+#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -37,7 +37,9 @@ class NonBlockingInvalidationNotifierTest : public testing::Test {
base::Thread::Options options;
options.message_loop_type = MessageLoop::TYPE_IO;
io_thread_.StartIOThread();
- request_context_getter_ = new TestURLRequestContextGetter;
+ request_context_getter_ =
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
notifier::NotifierOptions notifier_options;
notifier_options.request_context_getter = request_context_getter_;
invalidation_notifier_.reset(
diff --git a/chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc b/chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc
index 70783a5..89bf8eb 100644
--- a/chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc
+++ b/chrome/browser/sync/notifier/sync_notifier_factory_unittest.cc
@@ -17,8 +17,8 @@
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/syncable/model_type_payload_map.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/test/test_browser_thread.h"
+#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -39,7 +39,9 @@ class SyncNotifierFactoryTest : public testing::Test {
virtual ~SyncNotifierFactoryTest() {}
virtual void SetUp() OVERRIDE {
- request_context_getter_ = new TestURLRequestContextGetter;
+ request_context_getter_ =
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
factory_.reset(new SyncNotifierFactory(
"fake_client_info",
request_context_getter_,
diff --git a/chrome/browser/sync/tools/sync_listen_notifications.cc b/chrome/browser/sync/tools/sync_listen_notifications.cc
index c5836ab..76f8bce 100644
--- a/chrome/browser/sync/tools/sync_listen_notifications.cc
+++ b/chrome/browser/sync/tools/sync_listen_notifications.cc
@@ -21,9 +21,9 @@
#include "chrome/browser/sync/notifier/sync_notifier_observer.h"
#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/syncable/model_type_payload_map.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "content/public/browser/browser_thread.h"
#include "content/test/test_browser_thread.h"
+#include "net/url_request/url_request_test_util.h"
using content::BrowserThread;
@@ -125,7 +125,8 @@ int main(int argc, char* argv[]) {
const char kClientInfo[] = "sync_listen_notifications";
scoped_refptr<TestURLRequestContextGetter> request_context_getter(
- new TestURLRequestContextGetter());
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
NullInvalidationVersionTracker null_invalidation_version_tracker;
sync_notifier::SyncNotifierFactory sync_notifier_factory(
kClientInfo, request_context_getter,
diff --git a/chrome/browser/sync/tools/sync_tools.gyp b/chrome/browser/sync/tools/sync_tools.gyp
index 226ae62..fddbd34 100644
--- a/chrome/browser/sync/tools/sync_tools.gyp
+++ b/chrome/browser/sync/tools/sync_tools.gyp
@@ -16,6 +16,7 @@
'<(DEPTH)/chrome/chrome.gyp:test_support_common',
'<(DEPTH)/content/content.gyp:content_browser',
'<(DEPTH)/net/net.gyp:net',
+ '<(DEPTH)/net/net.gyp:net_test_support',
],
},
],
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 307e865..8a50040 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -59,7 +59,6 @@
'../ipc/ipc.gyp:test_support_ipc',
'../media/media.gyp:media_test_support',
'../net/net.gyp:net',
- # 'test/base/test_url_request_context_getter.h' brings in this requirement.
'../net/net.gyp:net_test_support',
'../skia/skia.gyp:skia',
'../testing/gmock.gyp:gmock',
@@ -236,8 +235,6 @@
'test/base/test_switches.h',
'test/base/test_tab_strip_model_observer.cc',
'test/base/test_tab_strip_model_observer.h',
- 'test/base/test_url_request_context_getter.cc',
- 'test/base/test_url_request_context_getter.h',
'test/base/testing_browser_process.cc',
'test/base/testing_browser_process.h',
'test/base/testing_pref_service.cc',
@@ -3689,6 +3686,7 @@
'../base/base.gyp:test_support_base',
'../jingle/jingle.gyp:notifier_test_util',
'../net/net.gyp:net',
+ '../net/net.gyp:net_test_support',
'../skia/skia.gyp:skia',
'../testing/gmock.gyp:gmock',
'../testing/gtest.gyp:gtest',
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
index 11be40d..5103ec8 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc
@@ -26,31 +26,18 @@ namespace {
const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data");
int g_request_context_getter_instances = 0;
-class TestURLRequestContextGetter : public net::URLRequestContextGetter {
+class TrackingTestURLRequestContextGetter
+ : public TestURLRequestContextGetter {
public:
- explicit TestURLRequestContextGetter(
+ explicit TrackingTestURLRequestContextGetter(
base::MessageLoopProxy* io_message_loop_proxy)
- : io_message_loop_proxy_(io_message_loop_proxy) {
+ : TestURLRequestContextGetter(io_message_loop_proxy) {
g_request_context_getter_instances++;
}
- virtual net::URLRequestContext* GetURLRequestContext() {
- if (!context_)
- context_ = new TestURLRequestContext();
- return context_;
- }
- virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const {
- return io_message_loop_proxy_;
- }
-
protected:
- scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
-
- private:
- virtual ~TestURLRequestContextGetter() {
+ virtual ~TrackingTestURLRequestContextGetter() {
g_request_context_getter_instances--;
}
-
- scoped_refptr<net::URLRequestContext> context_;
};
class TestCloudPrintURLFetcher : public CloudPrintURLFetcher {
@@ -61,7 +48,8 @@ class TestCloudPrintURLFetcher : public CloudPrintURLFetcher {
}
virtual net::URLRequestContextGetter* GetRequestContextGetter() {
- return new TestURLRequestContextGetter(io_message_loop_proxy_.get());
+ return new TrackingTestURLRequestContextGetter(
+ io_message_loop_proxy_.get());
}
private:
scoped_refptr<base::MessageLoopProxy> io_message_loop_proxy_;
diff --git a/chrome/test/base/test_url_request_context_getter.cc b/chrome/test/base/test_url_request_context_getter.cc
deleted file mode 100644
index 4cd0a89..0000000
--- a/chrome/test/base/test_url_request_context_getter.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-// 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.
-
-#include "chrome/test/base/test_url_request_context_getter.h"
-
-#include "content/public/browser/browser_thread.h"
-#include "net/url_request/url_request_test_util.h"
-
-using content::BrowserThread;
-
-TestURLRequestContextGetter::TestURLRequestContextGetter() {}
-
-TestURLRequestContextGetter::~TestURLRequestContextGetter() {}
-
-net::URLRequestContext* TestURLRequestContextGetter::GetURLRequestContext() {
- if (!context_)
- context_ = new TestURLRequestContext();
- return context_.get();
-}
-
-scoped_refptr<base::MessageLoopProxy>
-TestURLRequestContextGetter::GetIOMessageLoopProxy() const {
- return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
-}
diff --git a/chrome/test/base/test_url_request_context_getter.h b/chrome/test/base/test_url_request_context_getter.h
deleted file mode 100644
index 8dd7b52..0000000
--- a/chrome/test/base/test_url_request_context_getter.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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.
-
-#ifndef CHROME_TEST_BASE_TEST_URL_REQUEST_CONTEXT_GETTER_H_
-#define CHROME_TEST_BASE_TEST_URL_REQUEST_CONTEXT_GETTER_H_
-#pragma once
-
-#include "base/memory/ref_counted.h"
-#include "net/url_request/url_request_context_getter.h"
-
-namespace base {
-class MessageLoopProxy;
-}
-
-// Used to return a dummy context (normally the context is on the IO thread).
-// The one here can be run on the main test thread. Note that this can lead to
-// a leak if your test does not have a BrowserThread::IO in it because
-// URLRequestContextGetter is defined as a ReferenceCounted object with a
-// special trait that deletes it on the IO thread.
-class TestURLRequestContextGetter : public net::URLRequestContextGetter {
- public:
- TestURLRequestContextGetter();
- virtual ~TestURLRequestContextGetter();
-
- // net::URLRequestContextGetter implementation.
- virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE;
- virtual scoped_refptr<base::MessageLoopProxy>
- GetIOMessageLoopProxy() const OVERRIDE;
-
- private:
- scoped_refptr<net::URLRequestContext> context_;
-};
-
-#endif // CHROME_TEST_BASE_TEST_URL_REQUEST_CONTEXT_GETTER_H_
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 369cfaf..5e845fc 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -44,7 +44,6 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/bookmark_load_observer.h"
-#include "chrome/test/base/test_url_request_context_getter.h"
#include "chrome/test/base/testing_pref_service.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/browser/mock_resource_context.h"
@@ -595,7 +594,9 @@ net::URLRequestContextGetter* TestingProfile::GetRequestContextForRenderProcess(
void TestingProfile::CreateRequestContext() {
if (!request_context_)
- request_context_ = new TestURLRequestContextGetter();
+ request_context_ =
+ new TestURLRequestContextGetter(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
}
void TestingProfile::ResetRequestContext() {