Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: content/shell/renderer/test_runner/web_test_proxy.cc

Issue 598453004: Replace some hard coded schemes with the constants in /url/url_constants.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address the comment. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/savable_resources.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/test_runner/web_test_proxy.cc
diff --git a/content/shell/renderer/test_runner/web_test_proxy.cc b/content/shell/renderer/test_runner/web_test_proxy.cc
index 0aa1ee35293e10f60182ae3fbeb59bf3ba8e588f..7a9b989ffd389189c9b96c07109f0f7f2f9e1c46 100644
--- a/content/shell/renderer/test_runner/web_test_proxy.cc
+++ b/content/shell/renderer/test_runner/web_test_proxy.cc
@@ -149,7 +149,7 @@ void PrintResponseDescription(WebTestDelegate* delegate,
}
std::string URLDescription(const GURL& url) {
- if (url.SchemeIs("file"))
+ if (url.SchemeIs(url::kFileScheme))
return url.ExtractFileName();
return url.possibly_invalid_spec();
}
@@ -1158,11 +1158,12 @@ void WebTestProxyBase::WillSendRequest(
}
std::string host = url.host();
- if (!host.empty() && (url.SchemeIs("http") || url.SchemeIs("https"))) {
+ if (!host.empty() &&
+ (url.SchemeIs(url::kHttpScheme) || url.SchemeIs(url::kHttpsScheme))) {
if (!IsLocalHost(host) && !IsTestHost(host) &&
!HostIsUsedBySomeTestsToGenerateError(host) &&
- ((!main_document_url.SchemeIs("http") &&
- !main_document_url.SchemeIs("https")) ||
+ ((!main_document_url.SchemeIs(url::kHttpScheme) &&
+ !main_document_url.SchemeIs(url::kHttpsScheme)) ||
IsLocalHost(main_document_url.host())) &&
!delegate_->AllowExternalPages()) {
delegate_->PrintMessage(std::string("Blocked access to external URL ") +
« no previous file with comments | « content/renderer/savable_resources.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698