Chromium Code Reviews| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc |
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc |
| index c58f726fbb9c981b1913cb7640d24750f78f59a4..17454285c443f0e40954c92e272739caa7bd38a0 100644 |
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc |
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_service_client_unittest.cc |
| @@ -7,13 +7,14 @@ |
| #include <stddef.h> |
| #include <stdint.h> |
| +#include <memory> |
|
megjablon
2016/04/12 21:55:36
Can be eliminated since it's in .h
dcheng
2016/04/12 22:38:34
Done.
|
| #include <string> |
| #include <vector> |
| #include "base/base64.h" |
| #include "base/command_line.h" |
| #include "base/macros.h" |
| -#include "base/memory/scoped_ptr.h" |
| +#include "base/memory/ptr_util.h" |
| #include "base/metrics/field_trial.h" |
| #include "base/run_loop.h" |
| #include "base/test/histogram_tester.h" |
| @@ -259,7 +260,7 @@ class DataReductionProxyConfigServiceClientTest : public testing::Test { |
| void AddMockSuccess() { |
| socket_data_providers_.push_back( |
| - (make_scoped_ptr(new net::StaticSocketDataProvider( |
| + (base::WrapUnique(new net::StaticSocketDataProvider( |
| success_reads_, arraysize(success_reads_), nullptr, 0)))); |
| mock_socket_factory_->AddSocketDataProvider( |
| socket_data_providers_.back().get()); |
| @@ -267,7 +268,7 @@ class DataReductionProxyConfigServiceClientTest : public testing::Test { |
| void AddMockPreviousSuccess() { |
| socket_data_providers_.push_back( |
| - (make_scoped_ptr(new net::StaticSocketDataProvider( |
| + (base::WrapUnique(new net::StaticSocketDataProvider( |
| previous_success_reads_, arraysize(previous_success_reads_), |
| nullptr, 0)))); |
| mock_socket_factory_->AddSocketDataProvider( |
| @@ -276,7 +277,7 @@ class DataReductionProxyConfigServiceClientTest : public testing::Test { |
| void AddMockFailure() { |
| socket_data_providers_.push_back( |
| - (make_scoped_ptr(new net::StaticSocketDataProvider( |
| + (base::WrapUnique(new net::StaticSocketDataProvider( |
| not_found_reads_, arraysize(not_found_reads_), nullptr, 0)))); |
| mock_socket_factory_->AddSocketDataProvider( |
| socket_data_providers_.back().get()); |
| @@ -311,14 +312,14 @@ class DataReductionProxyConfigServiceClientTest : public testing::Test { |
| private: |
| base::MessageLoopForIO message_loop_; |
| - scoped_ptr<net::TestURLRequestContext> context_; |
| - scoped_ptr<net::MockClientSocketFactory> mock_socket_factory_; |
| + std::unique_ptr<net::TestURLRequestContext> context_; |
| + std::unique_ptr<net::MockClientSocketFactory> mock_socket_factory_; |
| - scoped_ptr<DataReductionProxyTestContext> test_context_; |
| - scoped_ptr<DataReductionProxyRequestOptions> request_options_; |
| + std::unique_ptr<DataReductionProxyTestContext> test_context_; |
| + std::unique_ptr<DataReductionProxyRequestOptions> request_options_; |
| std::vector<net::ProxyServer> enabled_proxies_for_http_; |
| - scoped_ptr<DataReductionProxyDelegate> delegate_; |
| + std::unique_ptr<DataReductionProxyDelegate> delegate_; |
| // A configuration from the current remote request. The encoded version is |
| // also stored. |
| @@ -332,14 +333,14 @@ class DataReductionProxyConfigServiceClientTest : public testing::Test { |
| std::string loaded_config_; |
| // Mock socket data. |
| - std::vector<scoped_ptr<net::SocketDataProvider>> socket_data_providers_; |
| + std::vector<std::unique_ptr<net::SocketDataProvider>> socket_data_providers_; |
| // Mock socket reads. |
| net::MockRead success_reads_[3]; |
| net::MockRead previous_success_reads_[3]; |
| net::MockRead not_found_reads_[2]; |
| - scoped_ptr<net::URLRequestContextStorage> context_storage_; |
| + std::unique_ptr<net::URLRequestContextStorage> context_storage_; |
| DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfigServiceClientTest); |
| }; |
| @@ -525,7 +526,7 @@ TEST_F(DataReductionProxyConfigServiceClientTest, OnIPAddressChange) { |
| const int kFailureCount = 5; |
| - std::vector<scoped_ptr<net::SocketDataProvider>> socket_data_providers; |
| + std::vector<std::unique_ptr<net::SocketDataProvider>> socket_data_providers; |
| for (int i = 0; i < kFailureCount; ++i) { |
| AddMockFailure(); |
| config_client()->RetrieveConfig(); |
| @@ -758,7 +759,7 @@ TEST_F(DataReductionProxyConfigServiceClientTest, HTTPRequests) { |
| net::TestDelegate test_delegate; |
| - scoped_ptr<net::URLRequest> request( |
| + std::unique_ptr<net::URLRequest> request( |
| test_url_request_context()->CreateRequest(GURL(tests[i].url), net::IDLE, |
| &test_delegate)); |
| request->Start(); |