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

Unified Diff: content/common/origin_util_unittest.cc

Issue 2005783005: Re-enable storage for Suborigins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 7 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
Index: content/common/origin_util_unittest.cc
diff --git a/content/common/origin_util_unittest.cc b/content/common/origin_util_unittest.cc
index 3c2328bff9928f5f5812f8169c354a2424e89401..fb557b0ea5fc96e2e9644f666ab7ea78d2b0fc57 100644
--- a/content/common/origin_util_unittest.cc
+++ b/content/common/origin_util_unittest.cc
@@ -47,4 +47,18 @@ TEST(URLSchemesTest, IsOriginSecure) {
IsOriginSecure(GURL("filesystem:https://www.example.com/temporary/")));
}
+TEST(OriginUtilTest, Suborigins) {
+ GURL no_suborigin_url("https://example.com");
+ GURL suborigin_url("https://foobar_example.com");
+
+ EXPECT_FALSE(HasSuborigin(no_suborigin_url));
+ EXPECT_TRUE(HasSuborigin(suborigin_url));
+
+ EXPECT_EQ("", SuboriginFromUrl(no_suborigin_url));
+ EXPECT_EQ("foobar", SuboriginFromUrl(suborigin_url));
+
+ EXPECT_EQ("example.com", HostFromUrlStripSuborigin(no_suborigin_url));
+ EXPECT_EQ("example.com", HostFromUrlStripSuborigin(suborigin_url));
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698