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

Unified Diff: url/gurl_unittest.cc

Issue 2403713002: Add suborigin logic to url::Origin (Closed)
Patch Set: Fix unit test Created 4 years, 2 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 | « url/gurl.h ('k') | url/origin.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/gurl_unittest.cc
diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc
index 6bfba708b9743e9b270d95cab25aa64884a99bae..d20256a712e87bf7fca48a4a6ca647a38685eec2 100644
--- a/url/gurl_unittest.cc
+++ b/url/gurl_unittest.cc
@@ -677,12 +677,42 @@ TEST(GURLTest, SchemeIsWSOrWSS) {
EXPECT_FALSE(GURL("http://bar/").SchemeIsWSOrWSS());
}
+TEST(GURLTest, SchemeIsCryptographic) {
+ EXPECT_TRUE(GURL("https://foo.bar.com/").SchemeIsCryptographic());
+ EXPECT_TRUE(GURL("HTTPS://foo.bar.com/").SchemeIsCryptographic());
+ EXPECT_TRUE(GURL("HtTpS://foo.bar.com/").SchemeIsCryptographic());
+
+ EXPECT_TRUE(GURL("wss://foo.bar.com/").SchemeIsCryptographic());
+ EXPECT_TRUE(GURL("WSS://foo.bar.com/").SchemeIsCryptographic());
+ EXPECT_TRUE(GURL("WsS://foo.bar.com/").SchemeIsCryptographic());
+
+ EXPECT_TRUE(GURL("https-so://foo.bar.com/").SchemeIsCryptographic());
+ EXPECT_TRUE(GURL("HTTPS-SO://foo.bar.com/").SchemeIsCryptographic());
+ EXPECT_TRUE(GURL("HtTpS-So://foo.bar.com/").SchemeIsCryptographic());
+
+ EXPECT_FALSE(GURL("http://foo.bar.com/").SchemeIsCryptographic());
+ EXPECT_FALSE(GURL("ws://foo.bar.com/").SchemeIsCryptographic());
+ EXPECT_FALSE(GURL("http-so://foo.bar.com/").SchemeIsCryptographic());
+}
+
TEST(GURLTest, SchemeIsBlob) {
EXPECT_TRUE(GURL("BLOB://BAR/").SchemeIsBlob());
EXPECT_TRUE(GURL("blob://bar/").SchemeIsBlob());
EXPECT_FALSE(GURL("http://bar/").SchemeIsBlob());
}
+TEST(GURLTest, SchemeIsSuborigin) {
+ EXPECT_TRUE(GURL("http-so://foo.bar.com/").SchemeIsSuborigin());
+ EXPECT_TRUE(GURL("HTTP-SO://foo.bar.com/").SchemeIsSuborigin());
+ EXPECT_TRUE(GURL("HtTp-So://foo.bar.com/").SchemeIsSuborigin());
+ EXPECT_FALSE(GURL("http://foo.bar.com/").SchemeIsSuborigin());
+
+ EXPECT_TRUE(GURL("https-so://foo.bar.com/").SchemeIsSuborigin());
+ EXPECT_TRUE(GURL("HTTPS-SO://foo.bar.com/").SchemeIsSuborigin());
+ EXPECT_TRUE(GURL("HtTpS-So://foo.bar.com/").SchemeIsSuborigin());
+ EXPECT_FALSE(GURL("https://foo.bar.com/").SchemeIsSuborigin());
+}
+
TEST(GURLTest, ContentAndPathForNonStandardURLs) {
struct TestCase {
const char* url;
« no previous file with comments | « url/gurl.h ('k') | url/origin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698