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

Unified Diff: content/public/test/test_browser_context.cc

Issue 17127002: Correctly integrate StoragePartition into TestingProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix InstantNTP test. Created 7 years, 5 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 | « content/public/test/mock_resource_context.cc ('k') | content/test/webrtc_audio_device_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_browser_context.cc
diff --git a/content/public/test/test_browser_context.cc b/content/public/test/test_browser_context.cc
index ae2fcff09f3084964c52d2612b5739a97a172bbb..907f748323d33a3fa4d16b3cf09533d5081e7db5 100644
--- a/content/public/test/test_browser_context.cc
+++ b/content/public/test/test_browser_context.cc
@@ -9,6 +9,7 @@
#include "content/public/test/mock_resource_context.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
+#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/browser/quota/special_storage_policy.h"
@@ -16,13 +17,12 @@ namespace {
class TestContextURLRequestContextGetter : public net::URLRequestContextGetter {
public:
- explicit TestContextURLRequestContextGetter(net::URLRequestContext* context)
- : context_(context),
- null_task_runner_(new base::NullTaskRunner) {
+ TestContextURLRequestContextGetter()
+ : null_task_runner_(new base::NullTaskRunner) {
}
virtual net::URLRequestContext* GetURLRequestContext() OVERRIDE {
- return context_;
+ return &context_;
}
virtual scoped_refptr<base::SingleThreadTaskRunner>
@@ -33,7 +33,7 @@ class TestContextURLRequestContextGetter : public net::URLRequestContextGetter {
private:
virtual ~TestContextURLRequestContextGetter() {}
- net::URLRequestContext* context_;
+ net::TestURLRequestContext context_;
scoped_refptr<base::SingleThreadTaskRunner> null_task_runner_;
};
@@ -71,8 +71,7 @@ DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() {
net::URLRequestContextGetter* TestBrowserContext::GetRequestContext() {
if (!request_context_.get()) {
- request_context_ = new TestContextURLRequestContextGetter(
- GetResourceContext()->GetRequestContext());
+ request_context_ = new TestContextURLRequestContextGetter();
}
return request_context_.get();
}
@@ -110,7 +109,8 @@ void TestBrowserContext::RequestMIDISysExPermission(
ResourceContext* TestBrowserContext::GetResourceContext() {
if (!resource_context_)
- resource_context_.reset(new MockResourceContext());
+ resource_context_.reset(new MockResourceContext(
+ GetRequestContext()->GetURLRequestContext()));
return resource_context_.get();
}
« no previous file with comments | « content/public/test/mock_resource_context.cc ('k') | content/test/webrtc_audio_device_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698