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

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 canonicalization layout test 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/document-domain-canonicalizes.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 TEST(BlinkPlatformTest, WebSecurityOriginNormalization) { 148 TEST(BlinkPlatformTest, WebSecurityOriginNormalization) {
149 struct TestCases { 149 struct TestCases {
150 const char* url; 150 const char* url;
151 } cases[] = {{""}, 151 } cases[] = {{""},
152 {"javascript:alert(1)"}, 152 {"javascript:alert(1)"},
153 {"file://example.com:443/etc/passwd"}, 153 {"file://example.com:443/etc/passwd"},
154 {"blob:https://example.com/uuid-goes-here"}, 154 {"blob:https://example.com/uuid-goes-here"},
155 {"filesystem:https://example.com/temporary/yay.png"}, 155 {"filesystem:https://example.com/temporary/yay.png"},
156 {"data"}, 156 {"data"},
157 {"blob:"}, 157 {"blob:"},
158 {"chrome://,/"},
158 {"xkcd://927"}, 159 {"xkcd://927"},
159 {"filesystem"}, 160 {"filesystem"},
160 {"data://example.com:80"}, 161 {"data://example.com:80"},
161 {"http://☃.net:80"}, 162 {"http://☃.net:80"},
162 {"http\nmore://example.com:80"}, 163 {"http\nmore://example.com:80"},
163 {"http\rmore://:example.com:80"}, 164 {"http\rmore://:example.com:80"},
164 {"http\n://example.com:80"}, 165 {"http\n://example.com:80"},
165 {"http\r://example.com:80"}, 166 {"http\r://example.com:80"},
166 {"http://example.com\nnot-example.com:80"}, 167 {"http://example.com\nnot-example.com:80"},
167 {"http://example.com\rnot-example.com:80"}, 168 {"http://example.com\rnot-example.com:80"},
168 {"http://example.com\n:80"}, 169 {"http://example.com\n:80"},
169 {"http://example.com\r:80"}, 170 {"http://example.com\r:80"},
170 {"http://example.com:0"}, 171 {"http://example.com:0"},
171 {"http://EXAMPLE.com"}, 172 {"http://EXAMPLE.com"},
172 {"http://EXAMPLE.com/%3Afoo"}, 173 {"http://EXAMPLE.com/%3Afoo"},
173 {"https://example.com:443"}, 174 {"https://example.com:443"},
174 {"file:///"}, 175 {"file:///"},
175 {"file:///root:80"}}; 176 {"file:///root:80"}};
176 177
177 for (const auto& test : cases) { 178 for (const auto& test : cases) {
178 SCOPED_TRACE(testing::Message() << test.url); 179 SCOPED_TRACE(testing::Message() << test.url);
179 blink::WebSecurityOrigin web_origin = 180 blink::WebSecurityOrigin web_origin =
180 blink::WebSecurityOrigin::createFromString( 181 blink::WebSecurityOrigin::createFromString(
181 blink::WebString::fromUTF8(test.url)); 182 blink::WebString::fromUTF8(test.url));
182 CheckCastedOriginsAlreadyNormalized(web_origin); 183 CheckCastedOriginsAlreadyNormalized(web_origin);
183 } 184 }
184 } 185 }
185 186
186 } // namespace content 187 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/document-domain-canonicalizes.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698