| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import "ios/web/public/test/response_providers/html_response_provider_impl.h" | 5 #import "ios/web/public/test/http_server/html_response_provider_impl.h" |
| 6 | 6 |
| 7 #import "ios/web/public/test/response_providers/response_provider.h" | 7 #import "ios/web/public/test/http_server/response_provider.h" |
| 8 #include "net/http/http_response_headers.h" | 8 #include "net/http/http_response_headers.h" |
| 9 #include "net/http/http_status_code.h" | 9 #include "net/http/http_status_code.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 std::map<GURL, HtmlResponseProviderImpl::Response> BuildResponseMap( | 13 std::map<GURL, HtmlResponseProviderImpl::Response> BuildResponseMap( |
| 14 const std::map<GURL, std::string>& responses_body, | 14 const std::map<GURL, std::string>& responses_body, |
| 15 scoped_refptr<net::HttpResponseHeaders> headers) { | 15 scoped_refptr<net::HttpResponseHeaders> headers) { |
| 16 std::map<GURL, HtmlResponseProviderImpl::Response> responses; | 16 std::map<GURL, HtmlResponseProviderImpl::Response> responses; |
| 17 for (const std::pair<const GURL, std::string>& pair : responses_body) { | 17 for (const std::pair<const GURL, std::string>& pair : responses_body) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void HtmlResponseProviderImpl::GetResponseHeadersAndBody( | 93 void HtmlResponseProviderImpl::GetResponseHeadersAndBody( |
| 94 const web::ResponseProvider::Request& request, | 94 const web::ResponseProvider::Request& request, |
| 95 scoped_refptr<net::HttpResponseHeaders>* headers, | 95 scoped_refptr<net::HttpResponseHeaders>* headers, |
| 96 std::string* response_body) { | 96 std::string* response_body) { |
| 97 const Response& response = responses_.at(request.url); | 97 const Response& response = responses_.at(request.url); |
| 98 *headers = response.headers; | 98 *headers = response.headers; |
| 99 *response_body = response.body; | 99 *response_body = response.body; |
| 100 } | 100 } |
| OLD | NEW |