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

Side by Side Diff: content/browser/loader/navigation_url_loader_unittest.cc

Issue 2256173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace a WrapUnique() nested inside a MakeUnique() Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 browser_context_(new TestBrowserContext) { 86 browser_context_(new TestBrowserContext) {
87 host_.SetLoaderDelegate(&loader_delegate_); 87 host_.SetLoaderDelegate(&loader_delegate_);
88 BrowserContext::EnsureResourceContextInitialized(browser_context_.get()); 88 BrowserContext::EnsureResourceContextInitialized(browser_context_.get());
89 base::RunLoop().RunUntilIdle(); 89 base::RunLoop().RunUntilIdle();
90 net::URLRequestContext* request_context = 90 net::URLRequestContext* request_context =
91 browser_context_->GetResourceContext()->GetRequestContext(); 91 browser_context_->GetResourceContext()->GetRequestContext();
92 // Attach URLRequestTestJob and make streams work. 92 // Attach URLRequestTestJob and make streams work.
93 job_factory_.SetProtocolHandler( 93 job_factory_.SetProtocolHandler(
94 "test", net::URLRequestTestJob::CreateProtocolHandler()); 94 "test", net::URLRequestTestJob::CreateProtocolHandler());
95 job_factory_.SetProtocolHandler( 95 job_factory_.SetProtocolHandler(
96 "blob", 96 "blob", base::MakeUnique<StreamProtocolHandler>(
97 base::WrapUnique(new StreamProtocolHandler( 97 StreamContext::GetFor(browser_context_.get())->registry()));
98 StreamContext::GetFor(browser_context_.get())->registry())));
99 request_context->set_job_factory(&job_factory_); 98 request_context->set_job_factory(&job_factory_);
100 99
101 // NavigationURLLoader is only used for browser-side navigations. 100 // NavigationURLLoader is only used for browser-side navigations.
102 base::CommandLine::ForCurrentProcess()->AppendSwitch( 101 base::CommandLine::ForCurrentProcess()->AppendSwitch(
103 switches::kEnableBrowserSideNavigation); 102 switches::kEnableBrowserSideNavigation);
104 } 103 }
105 104
106 std::unique_ptr<NavigationURLLoader> MakeTestLoader( 105 std::unique_ptr<NavigationURLLoader> MakeTestLoader(
107 const GURL& url, 106 const GURL& url,
108 NavigationURLLoaderDelegate* delegate) { 107 NavigationURLLoaderDelegate* delegate) {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 330
332 // Release the body. 331 // Release the body.
333 delegate.ReleaseBody(); 332 delegate.ReleaseBody();
334 base::RunLoop().RunUntilIdle(); 333 base::RunLoop().RunUntilIdle();
335 334
336 // Verify that URLRequestTestJob no longer has anything paused. 335 // Verify that URLRequestTestJob no longer has anything paused.
337 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage()); 336 EXPECT_FALSE(net::URLRequestTestJob::ProcessOnePendingMessage());
338 } 337 }
339 338
340 } // namespace content 339 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/async_revalidation_driver_unittest.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698