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

Side by Side Diff: content/child/blink_platform_impl_unittest.cc

Issue 2447293002: Don't call lower() on KURL protocol/host (Closed)
Patch Set: add canonicalizeHost() as static method on SecurityOrigin and call from Document::setDomain Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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/blink_platform_impl.h" 5 #include "content/child/blink_platform_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 TEST(BlinkPlatformTest, WebSecurityOriginNormalization) { 124 TEST(BlinkPlatformTest, WebSecurityOriginNormalization) {
125 struct TestCases { 125 struct TestCases {
126 const char* url; 126 const char* url;
127 } cases[] = {{""}, 127 } cases[] = {{""},
128 {"javascript:alert(1)"}, 128 {"javascript:alert(1)"},
129 {"file://example.com:443/etc/passwd"}, 129 {"file://example.com:443/etc/passwd"},
130 {"blob:https://example.com/uuid-goes-here"}, 130 {"blob:https://example.com/uuid-goes-here"},
131 {"filesystem:https://example.com/temporary/yay.png"}, 131 {"filesystem:https://example.com/temporary/yay.png"},
132 {"data"}, 132 {"data"},
133 {"blob:"}, 133 {"blob:"},
134 {"chrome://,/"},
134 {"xkcd://927"}, 135 {"xkcd://927"},
135 {"filesystem"}, 136 {"filesystem"},
136 {"data://example.com:80"}, 137 {"data://example.com:80"},
137 {"http://☃.net:80"}, 138 {"http://☃.net:80"},
138 {"http\nmore://example.com:80"}, 139 {"http\nmore://example.com:80"},
139 {"http\rmore://:example.com:80"}, 140 {"http\rmore://:example.com:80"},
140 {"http\n://example.com:80"}, 141 {"http\n://example.com:80"},
141 {"http\r://example.com:80"}, 142 {"http\r://example.com:80"},
142 {"http://example.com\nnot-example.com:80"}, 143 {"http://example.com\nnot-example.com:80"},
143 {"http://example.com\rnot-example.com:80"}, 144 {"http://example.com\rnot-example.com:80"},
144 {"http://example.com\n:80"}, 145 {"http://example.com\n:80"},
145 {"http://example.com\r:80"}, 146 {"http://example.com\r:80"},
146 {"http://example.com:0"}, 147 {"http://example.com:0"},
147 {"http://EXAMPLE.com"}, 148 {"http://EXAMPLE.com"},
148 {"http://EXAMPLE.com/%3Afoo"}, 149 {"http://EXAMPLE.com/%3Afoo"},
149 {"https://example.com:443"}, 150 {"https://example.com:443"},
150 {"file:///"}, 151 {"file:///"},
151 {"file:///root:80"}}; 152 {"file:///root:80"}};
152 153
153 for (const auto& test : cases) { 154 for (const auto& test : cases) {
154 SCOPED_TRACE(testing::Message() << test.url); 155 SCOPED_TRACE(testing::Message() << test.url);
155 blink::WebSecurityOrigin web_origin = 156 blink::WebSecurityOrigin web_origin =
156 blink::WebSecurityOrigin::createFromString( 157 blink::WebSecurityOrigin::createFromString(
157 blink::WebString::fromUTF8(test.url)); 158 blink::WebString::fromUTF8(test.url));
158 CheckCastedOriginsAlreadyNormalized(web_origin); 159 CheckCastedOriginsAlreadyNormalized(web_origin);
159 } 160 }
160 } 161 }
161 162
162 } // namespace content 163 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | third_party/WebKit/Source/core/dom/Document.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698