Chromium Code Reviews| Index: components/password_manager/core/browser/affiliation_utils_unittest.cc |
| diff --git a/components/password_manager/core/browser/affiliation_utils_unittest.cc b/components/password_manager/core/browser/affiliation_utils_unittest.cc |
| index 022edfc9fc9a209206a89427b93224bdde3f8b15..ebd87e225fa0af254c173d460516df8f6abb6556 100644 |
| --- a/components/password_manager/core/browser/affiliation_utils_unittest.cc |
| +++ b/components/password_manager/core/browser/affiliation_utils_unittest.cc |
| @@ -372,4 +372,23 @@ TEST_F(GetHumanReadableOriginTest, OriginFromAndroidForm) { |
| "android://com.example.android"); |
| } |
| +TEST(GetShownOriginTest, RemovePrefixes) { |
| + EXPECT_EQ(GetShownOrigin( |
| + GURL("http://subdomain.example.com:23/login/index.html"), ""), |
| + "subdomain.example.com:23"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://www.example.com"), ""), "example.com"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://mobile.example.com"), ""), |
| + "example.com"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://m.example.com"), ""), "example.com"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://m.subdomain.example.net"), ""), |
|
Evan Stade
2015/10/05 18:59:42
test upper case handling? non-ascii URL handling?
kolos1
2015/10/06 18:52:33
Tests with upper case letters has been added. Than
|
| + "subdomain.example.net"); |
| + |
| + EXPECT_EQ(GetShownOrigin(GURL("https://mobile.de"), ""), "mobile.de"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://www.de"), ""), "www.de"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://m.de"), ""), "m.de"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://www.mobile.de"), ""), "mobile.de"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://m.mobile.de"), ""), "mobile.de"); |
| + EXPECT_EQ(GetShownOrigin(GURL("https://m.www.de"), ""), "www.de"); |
|
Evan Stade
2015/10/05 18:59:42
nit: more readable if you do
struct {
std::stri
kolos1
2015/10/06 18:52:33
Done.
|
| +} |
| + |
| } // namespace password_manager |