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 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 ResourceDispatcher(nullptr, nullptr), | 61 ResourceDispatcher(nullptr, nullptr), |
62 canceled_(false), | 62 canceled_(false), |
63 defers_loading_(false) { | 63 defers_loading_(false) { |
64 } | 64 } |
65 | 65 |
66 ~TestResourceDispatcher() override {} | 66 ~TestResourceDispatcher() override {} |
67 | 67 |
68 // TestDispatcher implementation: | 68 // TestDispatcher implementation: |
69 | 69 |
70 int StartAsync(const RequestInfo& request_info, | 70 int StartAsync(const RequestInfo& request_info, |
71 ResourceRequestBody* request_body, | 71 ResourceRequestBodyImpl* request_body, |
72 std::unique_ptr<RequestPeer> peer) override { | 72 std::unique_ptr<RequestPeer> peer) override { |
73 EXPECT_FALSE(peer_); | 73 EXPECT_FALSE(peer_); |
74 peer_ = std::move(peer); | 74 peer_ = std::move(peer); |
75 url_ = request_info.url; | 75 url_ = request_info.url; |
76 stream_url_ = request_info.resource_body_stream_url; | 76 stream_url_ = request_info.resource_body_stream_url; |
77 return 1; | 77 return 1; |
78 } | 78 } |
79 | 79 |
80 void Cancel(int request_id) override { | 80 void Cancel(int request_id) override { |
81 EXPECT_FALSE(canceled_); | 81 EXPECT_FALSE(canceled_); |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 info.socket_address = net::HostPortPair(test.ip, 443); | 670 info.socket_address = net::HostPortPair(test.ip, 443); |
671 blink::WebURLResponse response; | 671 blink::WebURLResponse response; |
672 response.initialize(); | 672 response.initialize(); |
673 WebURLLoaderImpl::PopulateURLResponse(url, info, &response, true); | 673 WebURLLoaderImpl::PopulateURLResponse(url, info, &response, true); |
674 EXPECT_EQ(test.expected, response.remoteIPAddress().utf8()); | 674 EXPECT_EQ(test.expected, response.remoteIPAddress().utf8()); |
675 }; | 675 }; |
676 } | 676 } |
677 | 677 |
678 } // namespace | 678 } // namespace |
679 } // namespace content | 679 } // namespace content |
OLD | NEW |