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..b5cc150916f1d6aae1483269d35b19b72dd85a35 100644 |
| --- a/components/password_manager/core/browser/affiliation_utils_unittest.cc |
| +++ b/components/password_manager/core/browser/affiliation_utils_unittest.cc |
| @@ -372,4 +372,29 @@ TEST_F(GetHumanReadableOriginTest, OriginFromAndroidForm) { |
| "android://com.example.android"); |
| } |
| +TEST(GetShownOriginTest, RemovePrefixes) { |
| + struct { |
| + std::string input; |
| + std::string output; |
| + } kTestCases[] = { |
| + {"http://subdomain.example.com:80/login/index.html?h=90&ind=hello#first", |
| + "subdomain.example.com"}, |
| + {"https://www.example.com", "example.com"}, |
| + {"https://mobile.example.com", "example.com"}, |
| + {"https://m.example.com", "example.com"}, |
| + {"https://m.subdomain.example.net", "subdomain.example.net"}, |
| + {"https://mobile.de", "mobile.de"}, |
| + {"https://www.de", "www.de"}, |
| + {"https://m.de", "m.de"}, |
| + {"https://www.mobile.de", "mobile.de"}, |
| + {"https://m.mobile.de", "mobile.de"}, |
| + {"https://m.www.de", "www.de"}, |
| + {"https://Mobile.example.de", "example.de"}, |
| + {"https://WWW.Example.DE", "example.de"}}; |
| + |
| + for (const auto& test_case : kTestCases) { |
| + EXPECT_EQ(GetShownOrigin(GURL(test_case.input), ""), test_case.output); |
|
vabr (Chromium)
2015/10/15 11:58:26
Please also add the input to the error logs:
EXPE
vabr (Chromium)
2015/10/15 11:58:26
nit: The expected value goes first, so that EXPECT
kolos1
2015/10/16 14:19:25
Done.
kolos1
2015/10/16 14:19:26
Done.
|
| + } |
| +} |
| + |
| } // namespace password_manager |