diff options
author | mtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 07:53:56 +0000 |
---|---|---|
committer | mtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 07:53:56 +0000 |
commit | 18c1765290ee47aa386de972eb5fff6b53063f01 (patch) | |
tree | b1c0917b043789711dfc6e9f4554e9a8553eb194 /chrome/test/base/testing_browser_process.cc | |
parent | 404c3cb38341bf34e31640d65802d90dc3646a31 (diff) | |
download | chromium_src-18c1765290ee47aa386de972eb5fff6b53063f01.zip chromium_src-18c1765290ee47aa386de972eb5fff6b53063f01.tar.gz chromium_src-18c1765290ee47aa386de972eb5fff6b53063f01.tar.bz2 |
Added setting a context provider in testing_browser_process.cc.
This patch adds a getter and a setter for net::URLRequestContextGetter in TestingBrowserProcess class. This allows to write tests which uses URLFetcher as simple unit_test, not browser_test as before. This significantly speeds up such tests.
BUG=153996
Review URL: https://codereview.chromium.org/11359159
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167323 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/base/testing_browser_process.cc')
-rw-r--r-- | chrome/test/base/testing_browser_process.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc index 7bdd170..74b9b65 100644 --- a/chrome/test/base/testing_browser_process.cc +++ b/chrome/test/base/testing_browser_process.cc @@ -30,7 +30,8 @@ TestingBrowserProcess::TestingBrowserProcess() app_locale_("en"), local_state_(NULL), render_widget_snapshot_taker_(new RenderWidgetSnapshotTaker), - io_thread_(NULL) { + io_thread_(NULL), + system_request_context_(NULL) { } TestingBrowserProcess::~TestingBrowserProcess() { @@ -124,7 +125,7 @@ TestingBrowserProcess::safe_browsing_detection_service() { } net::URLRequestContextGetter* TestingBrowserProcess::system_request_context() { - return NULL; + return system_request_context_; } #if defined(OS_CHROMEOS) @@ -252,6 +253,11 @@ void TestingBrowserProcess::SetBookmarkPromptController( bookmark_prompt_controller_.reset(controller); } +void TestingBrowserProcess::SetSystemRequestContext( + net::URLRequestContextGetter* context_getter) { + system_request_context_ = context_getter; +} + void TestingBrowserProcess::SetLocalState(PrefService* local_state) { if (!local_state) { // The local_state_ PrefService is owned outside of TestingBrowserProcess, |