| 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/error_page_response_provider.h" | 5 #import "ios/web/public/test/http_server/error_page_response_provider.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "ios/web/public/test/http_server.h" | 8 #import "ios/web/public/test/http_server/http_server.h" |
| 9 #include "net/http/http_status_code.h" | 9 #include "net/http/http_status_code.h" |
| 10 | 10 |
| 11 // static | 11 // static |
| 12 GURL ErrorPageResponseProvider::GetDnsFailureUrl() { | 12 GURL ErrorPageResponseProvider::GetDnsFailureUrl() { |
| 13 return GURL("http://mock/bad"); | 13 return GURL("http://mock/bad"); |
| 14 } | 14 } |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 GURL ErrorPageResponseProvider::GetRedirectToDnsFailureUrl() { | 17 GURL ErrorPageResponseProvider::GetRedirectToDnsFailureUrl() { |
| 18 return web::test::HttpServer::MakeUrl("http://mock/redirect"); | 18 return web::test::HttpServer::MakeUrl("http://mock/redirect"); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 if (HtmlResponseProvider::CanHandleRequest(request)) { | 32 if (HtmlResponseProvider::CanHandleRequest(request)) { |
| 33 HtmlResponseProvider::GetResponseHeadersAndBody(request, headers, | 33 HtmlResponseProvider::GetResponseHeadersAndBody(request, headers, |
| 34 response_body); | 34 response_body); |
| 35 } else if (request.url == GetRedirectToDnsFailureUrl()) { | 35 } else if (request.url == GetRedirectToDnsFailureUrl()) { |
| 36 *headers = web::ResponseProvider::GetRedirectResponseHeaders( | 36 *headers = web::ResponseProvider::GetRedirectResponseHeaders( |
| 37 ErrorPageResponseProvider::GetDnsFailureUrl().spec(), net::HTTP_FOUND); | 37 ErrorPageResponseProvider::GetDnsFailureUrl().spec(), net::HTTP_FOUND); |
| 38 } else { | 38 } else { |
| 39 NOTREACHED(); | 39 NOTREACHED(); |
| 40 } | 40 } |
| 41 } | 41 } |
| OLD | NEW |