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

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

Issue 2042033003: Displaying human-readable Android credentials on Android OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit test for SplitByDotAndReverse, addressed style issues. Created 4 years, 6 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/password_ui_utils_unittest.cc
diff --git a/components/password_manager/core/browser/password_ui_utils_unittest.cc b/components/password_manager/core/browser/password_ui_utils_unittest.cc
index 780fa8c50e468c9fde8c98658af768d3efbd845c..6d7e0748b8d444ecee8f980dd1513021d81934d0 100644
--- a/components/password_manager/core/browser/password_ui_utils_unittest.cc
+++ b/components/password_manager/core/browser/password_ui_utils_unittest.cc
@@ -93,4 +93,16 @@ TEST(GetShownOriginAndLinkUrlTest, OriginFromNonAndroidForm) {
EXPECT_EQ(form.origin, link_url);
}
+TEST(SplitByDotAndReverseTest, ReversedHostname) {
+ const struct {
+ const base::StringPiece input;
+ const std::string output;
+ } kTestCases[] = {{"com.example.android", "android.example.com"},
+ {"com.example.mobile", "mobile.example.com"},
+ {"net.example.subdomain", "subdomain.example.net"}};
+ for (const auto& test_case : kTestCases) {
+ EXPECT_EQ(test_case.output, SplitByDotAndReverse(test_case.input));
+ }
+}
+
} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698