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

Unified Diff: net/http/http_stream_factory_impl_job_controller_unittest.cc

Issue 2255883002: Pass ClientSocketHandle ownership around in unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « net/http/http_stream_factory_impl_job.cc ('k') | net/websockets/websocket_basic_handshake_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job_controller_unittest.cc
diff --git a/net/http/http_stream_factory_impl_job_controller_unittest.cc b/net/http/http_stream_factory_impl_job_controller_unittest.cc
index 6cc218be5b0e9b1c78e0d3a0db36b60ed6d7aaac..66d544b2b02540ca6be147faa04c2a3db92299b4 100644
--- a/net/http/http_stream_factory_impl_job_controller_unittest.cc
+++ b/net/http/http_stream_factory_impl_job_controller_unittest.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_basic_stream.h"
@@ -235,7 +236,7 @@ TEST_F(HttpStreamFactoryImplJobControllerTest,
// There's no other alternative job. Thus when stream is ready, it should
// notify Request.
HttpStream* http_stream =
- new HttpBasicStream(new ClientSocketHandle(), false);
+ new HttpBasicStream(base::MakeUnique<ClientSocketHandle>(), false);
job_factory_.main_job()->SetStream(http_stream);
EXPECT_CALL(request_delegate_, OnStreamReady(_, _, http_stream))
@@ -353,7 +354,7 @@ TEST_F(HttpStreamFactoryImplJobControllerTest,
// to Request. The alternative job will mark the main job complete and gets
// orphaned.
HttpStream* http_stream =
- new HttpBasicStream(new ClientSocketHandle(), false);
+ new HttpBasicStream(base::MakeUnique<ClientSocketHandle>(), false);
job_factory_.main_job()->SetStream(http_stream);
EXPECT_CALL(request_delegate_, OnStreamReady(_, _, http_stream))
@@ -412,7 +413,7 @@ TEST_F(HttpStreamFactoryImplJobControllerTest,
// |alternative_job| succeeds and should report status to Request.
HttpStream* http_stream =
- new HttpBasicStream(new ClientSocketHandle(), false);
+ new HttpBasicStream(base::MakeUnique<ClientSocketHandle>(), false);
job_factory_.alternative_job()->SetStream(http_stream);
EXPECT_CALL(request_delegate_, OnStreamReady(_, _, http_stream))
@@ -463,7 +464,7 @@ TEST_F(HttpStreamFactoryImplJobControllerTest, GetLoadStateAfterMainJobFailed) {
// |alternative_job| succeeds and should report status to Request.
HttpStream* http_stream =
- new HttpBasicStream(new ClientSocketHandle(), false);
+ new HttpBasicStream(base::MakeUnique<ClientSocketHandle>(), false);
job_factory_.alternative_job()->SetStream(http_stream);
EXPECT_CALL(request_delegate_, OnStreamReady(_, _, http_stream))
« no previous file with comments | « net/http/http_stream_factory_impl_job.cc ('k') | net/websockets/websocket_basic_handshake_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698