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

Unified Diff: components/password_manager/core/browser/affiliation_utils_unittest.cc

Issue 1318523011: [Password Manager] Copiable username and origin. Linkable origin elided from the left. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments to new css classes. Removed left align for rtl locales. Created 5 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
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

Powered by Google App Engine
This is Rietveld 408576698