| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/child/web_url_loader_impl.h" | 5 #include "content/child/web_url_loader_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 public: | 57 public: |
| 58 TestResourceDispatcher() : | 58 TestResourceDispatcher() : |
| 59 ResourceDispatcher(nullptr, nullptr), | 59 ResourceDispatcher(nullptr, nullptr), |
| 60 canceled_(false) { | 60 canceled_(false) { |
| 61 } | 61 } |
| 62 | 62 |
| 63 ~TestResourceDispatcher() override {} | 63 ~TestResourceDispatcher() override {} |
| 64 | 64 |
| 65 // TestDispatcher implementation: | 65 // TestDispatcher implementation: |
| 66 | 66 |
| 67 int StartAsync(const RequestInfo& request_info, | 67 int StartAsync( |
| 68 ResourceRequestBody* request_body, | 68 const RequestInfo& request_info, |
| 69 scoped_ptr<RequestPeer> peer) override { | 69 ResourceRequestBody* request_body, |
| 70 scoped_ptr<RequestPeer> peer, |
| 71 mojo::ScopedDataPipeConsumerHandle mojo_data_pipe_handle) override { |
| 70 EXPECT_FALSE(peer_); | 72 EXPECT_FALSE(peer_); |
| 73 EXPECT_FALSE(mojo_data_pipe_handle.is_valid()); |
| 71 peer_ = std::move(peer); | 74 peer_ = std::move(peer); |
| 72 url_ = request_info.url; | 75 url_ = request_info.url; |
| 73 stream_url_ = request_info.resource_body_stream_url; | 76 stream_url_ = request_info.resource_body_stream_url; |
| 74 return 1; | 77 return 1; |
| 75 } | 78 } |
| 76 | 79 |
| 77 void Cancel(int request_id) override { | 80 void Cancel(int request_id) override { |
| 78 EXPECT_FALSE(canceled_); | 81 EXPECT_FALSE(canceled_); |
| 79 canceled_ = true; | 82 canceled_ = true; |
| 80 } | 83 } |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 info.socket_address = net::HostPortPair(test.ip, 443); | 623 info.socket_address = net::HostPortPair(test.ip, 443); |
| 621 blink::WebURLResponse response; | 624 blink::WebURLResponse response; |
| 622 response.initialize(); | 625 response.initialize(); |
| 623 WebURLLoaderImpl::PopulateURLResponse(url, info, &response, true); | 626 WebURLLoaderImpl::PopulateURLResponse(url, info, &response, true); |
| 624 EXPECT_EQ(test.expected, response.remoteIPAddress().utf8()); | 627 EXPECT_EQ(test.expected, response.remoteIPAddress().utf8()); |
| 625 }; | 628 }; |
| 626 } | 629 } |
| 627 | 630 |
| 628 } // namespace | 631 } // namespace |
| 629 } // namespace content | 632 } // namespace content |
| OLD | NEW |