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

Unified Diff: url/scheme_host_port_unittest.cc

Issue 2560923002: [url] Remove comparisons for blob/filesystem schemes in scheme_host_port (Closed)
Patch Set: Remove DCHECK, add comment to unit test (trybots prev) Created 4 years 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 | « url/scheme_host_port.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/scheme_host_port_unittest.cc
diff --git a/url/scheme_host_port_unittest.cc b/url/scheme_host_port_unittest.cc
index 81d4371a85b04f5fbd0f2592e705ab6800115a42..ba97a6a54922711b4cd50e827445933f25312781 100644
--- a/url/scheme_host_port_unittest.cc
+++ b/url/scheme_host_port_unittest.cc
@@ -42,11 +42,19 @@ TEST(SchemeHostPortTest, Invalid) {
EXPECT_TRUE(invalid.IsInvalid());
EXPECT_TRUE(invalid.Equals(invalid));
- const char* urls[] = {"data:text/html,Hello!",
- "javascript:alert(1)",
- "file://example.com:443/etc/passwd",
- "blob:https://example.com/uuid-goes-here",
- "filesystem:https://example.com/temporary/yay.png"};
+ const char* urls[] = {
+ "data:text/html,Hello!", "javascript:alert(1)",
+ "file://example.com:443/etc/passwd",
+
+ // These schemes do not follow the generic URL syntax, so make sure we
+ // treat them as invalid (scheme, host, port) tuples (even though such
+ // URLs' _Origin_ might have a (scheme, host, port) tuple, they themselves
+ // do not). This is only *implicitly* checked in the code, by means of
+ // blob schemes not being standard, and filesystem schemes having type
+ // SCHEME_WITHOUT_AUTHORITY. If conditions change such that the implicit
+ // checks no longer hold, this policy should be made explicit.
+ "blob:https://example.com/uuid-goes-here",
+ "filesystem:https://example.com/temporary/yay.png"};
for (auto* test : urls) {
SCOPED_TRACE(test);
« no previous file with comments | « url/scheme_host_port.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698