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

Unified Diff: content/browser/loader/url_loader_factory_impl_unittest.cc

Issue 2785523002: Reduce/remove usage of BrowserThread in content/browser/loader. (Closed)
Patch Set: Remove DCHECK Created 3 years, 9 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
Index: content/browser/loader/url_loader_factory_impl_unittest.cc
diff --git a/content/browser/loader/url_loader_factory_impl_unittest.cc b/content/browser/loader/url_loader_factory_impl_unittest.cc
index 007dca1e4dc48f451a32610ebb7cac9b3a10ba68..e2b4add3f800dad95bfeebe998ec6ead5f677a4d 100644
--- a/content/browser/loader/url_loader_factory_impl_unittest.cc
+++ b/content/browser/loader/url_loader_factory_impl_unittest.cc
@@ -81,7 +81,8 @@ class RejectingResourceDispatcherHostDelegate final
class URLLoaderFactoryImplTest : public ::testing::TestWithParam<size_t> {
public:
URLLoaderFactoryImplTest()
- : thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP),
+ : thread_bundle_(
+ new TestBrowserThreadBundle(TestBrowserThreadBundle::IO_MAINLOOP)),
browser_context_(new TestBrowserContext()),
resource_message_filter_(new ResourceMessageFilter(
kChildId,
@@ -90,7 +91,8 @@ class URLLoaderFactoryImplTest : public ::testing::TestWithParam<size_t> {
nullptr,
nullptr,
base::Bind(&URLLoaderFactoryImplTest::GetContexts,
- base::Unretained(this)))) {
+ base::Unretained(this)),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))) {
// Some tests specify request.report_raw_headers, but the RDH checks the
// CanReadRawCookies permission before enabling it.
ChildProcessSecurityPolicyImpl::GetInstance()->Add(kChildId);
@@ -103,7 +105,8 @@ class URLLoaderFactoryImplTest : public ::testing::TestWithParam<size_t> {
URLLoaderFactoryImpl::Create(
resource_message_filter_->requester_info_for_test(),
- mojo::MakeRequest(&factory_));
+ mojo::MakeRequest(&factory_),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
// Calling this function creates a request context.
browser_context_->GetResourceContext()->GetRequestContext();
@@ -120,6 +123,7 @@ class URLLoaderFactoryImplTest : public ::testing::TestWithParam<size_t> {
base::RunLoop().RunUntilIdle();
MojoAsyncResourceHandler::SetAllocationSizeForTesting(
MojoAsyncResourceHandler::kDefaultAllocationSize);
+ thread_bundle_.reset(nullptr);
}
void GetContexts(ResourceType resource_type,
@@ -130,7 +134,7 @@ class URLLoaderFactoryImplTest : public ::testing::TestWithParam<size_t> {
browser_context_->GetResourceContext()->GetRequestContext();
}
- TestBrowserThreadBundle thread_bundle_;
+ std::unique_ptr<TestBrowserThreadBundle> thread_bundle_;
LoaderDelegateImpl loader_deleate_;
ResourceDispatcherHostImpl rdh_;
std::unique_ptr<TestBrowserContext> browser_context_;
« no previous file with comments | « content/browser/loader/url_loader_factory_impl.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698