| 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 "components/test_runner/web_test_proxy.h" | 5 #include "components/test_runner/web_test_proxy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <cctype> | 10 #include <cctype> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 default: | 193 default: |
| 194 return "Unresolved"; | 194 return "Unresolved"; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 void BlockRequest(blink::WebURLRequest& request) { | 198 void BlockRequest(blink::WebURLRequest& request) { |
| 199 request.setURL(GURL("255.255.255.255")); | 199 request.setURL(GURL("255.255.255.255")); |
| 200 } | 200 } |
| 201 | 201 |
| 202 bool IsLocalHost(const std::string& host) { | 202 bool IsLocalHost(const std::string& host) { |
| 203 return host == "127.0.0.1" || host == "localhost"; | 203 return host == "127.0.0.1" || host == "localhost" || host == "[::1]"; |
| 204 } | 204 } |
| 205 | 205 |
| 206 bool IsTestHost(const std::string& host) { | 206 bool IsTestHost(const std::string& host) { |
| 207 return base::EndsWith(host, ".test", base::CompareCase::INSENSITIVE_ASCII); | 207 return base::EndsWith(host, ".test", base::CompareCase::INSENSITIVE_ASCII); |
| 208 } | 208 } |
| 209 | 209 |
| 210 bool HostIsUsedBySomeTestsToGenerateError(const std::string& host) { | 210 bool HostIsUsedBySomeTestsToGenerateError(const std::string& host) { |
| 211 return host == "255.255.255.255"; | 211 return host == "255.255.255.255"; |
| 212 } | 212 } |
| 213 | 213 |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 callback->onError(blink::WebSetSinkIdError::NotAuthorized); | 1296 callback->onError(blink::WebSetSinkIdError::NotAuthorized); |
| 1297 else | 1297 else |
| 1298 callback->onError(blink::WebSetSinkIdError::NotFound); | 1298 callback->onError(blink::WebSetSinkIdError::NotFound); |
| 1299 } | 1299 } |
| 1300 | 1300 |
| 1301 blink::WebString WebTestProxyBase::acceptLanguages() { | 1301 blink::WebString WebTestProxyBase::acceptLanguages() { |
| 1302 return blink::WebString::fromUTF8(accept_languages_); | 1302 return blink::WebString::fromUTF8(accept_languages_); |
| 1303 } | 1303 } |
| 1304 | 1304 |
| 1305 } // namespace test_runner | 1305 } // namespace test_runner |
| OLD | NEW |