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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc

Issue 1873263002: Convert //components/data_reduction_proxy from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address feedback Created 4 years, 8 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: components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc
index e6b4dc8f58f5fbd810875dbbda8a0449c8685e04..351f21e7c417b2176854c7c673f99b6dc7d58678 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data_unittest.cc
@@ -6,8 +6,8 @@
#include <stddef.h>
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
@@ -19,7 +19,6 @@
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/testing_pref_service.h"
-
#include "net/http/http_network_session.h"
#include "net/log/net_log.h"
#include "net/proxy/proxy_info.h"
@@ -97,10 +96,11 @@ class DataReductionProxyIODataTest : public testing::Test {
};
TEST_F(DataReductionProxyIODataTest, TestConstruction) {
- scoped_ptr<DataReductionProxyIOData> io_data(new DataReductionProxyIOData(
- Client::UNKNOWN, DataReductionProxyParams::kAllowed, net_log(),
- task_runner(), task_runner(), false /* enabled */,
- false /* enable_quic */, std::string() /* user_agent */));
+ std::unique_ptr<DataReductionProxyIOData> io_data(
+ new DataReductionProxyIOData(
+ Client::UNKNOWN, DataReductionProxyParams::kAllowed, net_log(),
+ task_runner(), task_runner(), false /* enabled */,
+ false /* enable_quic */, std::string() /* user_agent */));
// Check that the SimpleURLRequestContextGetter uses vanilla HTTP.
net::URLRequestContext* request_context =
@@ -115,21 +115,20 @@ TEST_F(DataReductionProxyIODataTest, TestConstruction) {
// Check that io_data creates an interceptor. Such an interceptor is
// thoroughly tested by DataReductionProxyInterceptoTest.
- scoped_ptr<net::URLRequestInterceptor> interceptor =
+ std::unique_ptr<net::URLRequestInterceptor> interceptor =
io_data->CreateInterceptor();
EXPECT_NE(nullptr, interceptor.get());
// When creating a network delegate, expect that it properly wraps a
// network delegate. Such a network delegate is thoroughly tested by
// DataReductionProxyNetworkDelegateTest.
- scoped_ptr<net::URLRequest> fake_request =
- context().CreateRequest(
- GURL("http://www.foo.com/"), net::IDLE, delegate());
+ std::unique_ptr<net::URLRequest> fake_request = context().CreateRequest(
+ GURL("http://www.foo.com/"), net::IDLE, delegate());
CountingNetworkDelegate* wrapped_network_delegate =
new CountingNetworkDelegate();
- scoped_ptr<DataReductionProxyNetworkDelegate> network_delegate =
- io_data->CreateNetworkDelegate(
- make_scoped_ptr(wrapped_network_delegate), false);
+ std::unique_ptr<DataReductionProxyNetworkDelegate> network_delegate =
+ io_data->CreateNetworkDelegate(base::WrapUnique(wrapped_network_delegate),
+ false);
network_delegate->NotifyBeforeURLRequest(
fake_request.get(),
base::Bind(&DataReductionProxyIODataTest::RequestCallback,
@@ -139,8 +138,8 @@ TEST_F(DataReductionProxyIODataTest, TestConstruction) {
// Creating a second delegate with bypass statistics tracking should result
// in usage stats being created.
- io_data->CreateNetworkDelegate(make_scoped_ptr(new CountingNetworkDelegate()),
- true);
+ io_data->CreateNetworkDelegate(
+ base::WrapUnique(new CountingNetworkDelegate()), true);
EXPECT_NE(nullptr, io_data->bypass_stats());
io_data->ShutdownOnUIThread();
@@ -148,7 +147,7 @@ TEST_F(DataReductionProxyIODataTest, TestConstruction) {
TEST_F(DataReductionProxyIODataTest, TestResetBadProxyListOnDisableDataSaver) {
net::TestURLRequestContext context(false);
- scoped_ptr<DataReductionProxyTestContext> drp_test_context =
+ std::unique_ptr<DataReductionProxyTestContext> drp_test_context =
DataReductionProxyTestContext::Builder()
.WithParamsFlags(DataReductionProxyParams::kAllowed |
DataReductionProxyParams::kFallbackAllowed |

Powered by Google App Engine
This is Rietveld 408576698