| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |