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

Side by Side Diff: net/http/http_network_transaction_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 unified diff | Download patch
« no previous file with comments | « net/http/http_basic_stream.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <stdarg.h> 8 #include <stdarg.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 14278 matching lines...) Expand 10 before | Expand all | Expand 10 after
14289 DISALLOW_COPY_AND_ASSIGN(FakeStreamFactory); 14289 DISALLOW_COPY_AND_ASSIGN(FakeStreamFactory);
14290 }; 14290 };
14291 14291
14292 // TODO(ricea): Maybe unify this with the one in 14292 // TODO(ricea): Maybe unify this with the one in
14293 // url_request_http_job_unittest.cc ? 14293 // url_request_http_job_unittest.cc ?
14294 class FakeWebSocketBasicHandshakeStream : public WebSocketHandshakeStreamBase { 14294 class FakeWebSocketBasicHandshakeStream : public WebSocketHandshakeStreamBase {
14295 public: 14295 public:
14296 FakeWebSocketBasicHandshakeStream( 14296 FakeWebSocketBasicHandshakeStream(
14297 std::unique_ptr<ClientSocketHandle> connection, 14297 std::unique_ptr<ClientSocketHandle> connection,
14298 bool using_proxy) 14298 bool using_proxy)
14299 : state_(connection.release(), using_proxy) {} 14299 : state_(std::move(connection), using_proxy) {}
14300 14300
14301 // Fake implementation of HttpStreamBase methods. 14301 // Fake implementation of HttpStreamBase methods.
14302 // This ends up being quite "real" because this object has to really send data 14302 // This ends up being quite "real" because this object has to really send data
14303 // on the mock socket. It might be easier to use the real implementation, but 14303 // on the mock socket. It might be easier to use the real implementation, but
14304 // the fact that the WebSocket code is not compiled on iOS makes that 14304 // the fact that the WebSocket code is not compiled on iOS makes that
14305 // difficult. 14305 // difficult.
14306 int InitializeStream(const HttpRequestInfo* request_info, 14306 int InitializeStream(const HttpRequestInfo* request_info,
14307 RequestPriority priority, 14307 RequestPriority priority,
14308 const BoundNetLog& net_log, 14308 const BoundNetLog& net_log,
14309 const CompletionCallback& callback) override { 14309 const CompletionCallback& callback) override {
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
15521 base::RunLoop().RunUntilIdle(); 15521 base::RunLoop().RunUntilIdle();
15522 15522
15523 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy); 15523 EXPECT_TRUE(trans.GetResponseInfo()->was_fetched_via_spdy);
15524 HttpRequestHeaders headers; 15524 HttpRequestHeaders headers;
15525 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers)); 15525 ASSERT_TRUE(trans.GetFullRequestHeaders(&headers));
15526 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding)); 15526 EXPECT_TRUE(headers.HasHeader(HttpRequestHeaders::kTokenBinding));
15527 } 15527 }
15528 #endif // !defined(OS_IOS) 15528 #endif // !defined(OS_IOS)
15529 15529
15530 } // namespace net 15530 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_basic_stream.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698