| Index: ios/net/protocol_handler_util_unittest.mm
|
| diff --git a/ios/net/protocol_handler_util_unittest.mm b/ios/net/protocol_handler_util_unittest.mm
|
| index 5e7226fdcf775a798ba746903c1cab1922c9f9ca..eab533837c40c117c024d36bff5e747a3275d168 100644
|
| --- a/ios/net/protocol_handler_util_unittest.mm
|
| +++ b/ios/net/protocol_handler_util_unittest.mm
|
| @@ -4,10 +4,11 @@
|
|
|
| #import "ios/net/protocol_handler_util.h"
|
|
|
| +#include <memory>
|
| #include <utility>
|
|
|
| #include "base/mac/scoped_nsobject.h"
|
| -#include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/run_loop.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| @@ -114,9 +115,9 @@ class ProtocolHandlerUtilTest : public testing::Test,
|
| ProtocolHandlerUtilTest() : request_context_(new TestURLRequestContext) {
|
| // Ownership of the protocol handlers is transferred to the factory.
|
| job_factory_.SetProtocolHandler("http",
|
| - make_scoped_ptr(new NetProtocolHandler));
|
| + base::WrapUnique(new NetProtocolHandler));
|
| job_factory_.SetProtocolHandler("data",
|
| - make_scoped_ptr(new DataProtocolHandler));
|
| + base::WrapUnique(new DataProtocolHandler));
|
| request_context_->set_job_factory(&job_factory_);
|
| }
|
|
|
| @@ -131,7 +132,7 @@ class ProtocolHandlerUtilTest : public testing::Test,
|
| url_string += ",";
|
| GURL url(url_string);
|
|
|
| - scoped_ptr<URLRequest> request(
|
| + std::unique_ptr<URLRequest> request(
|
| request_context_->CreateRequest(url, DEFAULT_PRIORITY, this));
|
| request->Start();
|
| base::RunLoop loop;
|
| @@ -155,7 +156,7 @@ class ProtocolHandlerUtilTest : public testing::Test,
|
| protected:
|
| base::MessageLoop loop_;
|
| URLRequestJobFactoryImpl job_factory_;
|
| - scoped_ptr<URLRequestContext> request_context_;
|
| + std::unique_ptr<URLRequestContext> request_context_;
|
| };
|
|
|
| } // namespace
|
| @@ -173,7 +174,7 @@ TEST_F(ProtocolHandlerUtilTest, GetResponseDataSchemeTest) {
|
| TEST_F(ProtocolHandlerUtilTest, GetResponseHttpTest) {
|
| // Create a request.
|
| GURL url(std::string("http://url"));
|
| - scoped_ptr<URLRequest> request(
|
| + std::unique_ptr<URLRequest> request(
|
| request_context_->CreateRequest(url, DEFAULT_PRIORITY, this));
|
| request->Start();
|
| // Create a response from the request.
|
| @@ -200,7 +201,7 @@ TEST_F(ProtocolHandlerUtilTest, BadHttpContentType) {
|
| // Create a request using the magic domain that triggers a garbage
|
| // content-type in the test framework.
|
| GURL url(std::string("http://badcontenttype"));
|
| - scoped_ptr<URLRequest> request(
|
| + std::unique_ptr<URLRequest> request(
|
| request_context_->CreateRequest(url, DEFAULT_PRIORITY, this));
|
| request->Start();
|
| // Create a response from the request.
|
| @@ -216,7 +217,7 @@ TEST_F(ProtocolHandlerUtilTest, MultipleHttpContentType) {
|
| // Create a request using the magic domain that triggers a garbage
|
| // content-type in the test framework.
|
| GURL url(std::string("http://multiplecontenttype"));
|
| - scoped_ptr<URLRequest> request(
|
| + std::unique_ptr<URLRequest> request(
|
| request_context_->CreateRequest(url, DEFAULT_PRIORITY, this));
|
| request->Start();
|
| // Create a response from the request.
|
| @@ -239,7 +240,7 @@ TEST_F(ProtocolHandlerUtilTest, CopyHttpHeaders) {
|
| @"Accept" : @"money/cash",
|
| @"Foo" : @"bar",
|
| }];
|
| - scoped_ptr<URLRequest> out_request(
|
| + std::unique_ptr<URLRequest> out_request(
|
| request_context_->CreateRequest(url, DEFAULT_PRIORITY, nullptr));
|
| CopyHttpHeaders(in_request, out_request.get());
|
|
|
| @@ -258,10 +259,10 @@ TEST_F(ProtocolHandlerUtilTest, AddMissingHeaders) {
|
| GURL url(std::string("http://url"));
|
| base::scoped_nsobject<NSMutableURLRequest> in_request(
|
| [[NSMutableURLRequest alloc] initWithURL:NSURLWithGURL(url)]);
|
| - scoped_ptr<URLRequest> out_request(
|
| + std::unique_ptr<URLRequest> out_request(
|
| request_context_->CreateRequest(url, DEFAULT_PRIORITY, nullptr));
|
| out_request->set_method("POST");
|
| - scoped_ptr<UploadElementReader> reader(
|
| + std::unique_ptr<UploadElementReader> reader(
|
| new UploadBytesElementReader(nullptr, 0));
|
| out_request->set_upload(
|
| ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
|
|
|