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

Unified Diff: chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc

Issue 1837043003: Add a title for the account chooser for one credential displayed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc
diff --git a/chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc
index 4b0d891c84b2a57d921dbde3bb8aa04c17b6186a..cf015b512502dff2284738d58ebe87aa881bd7e8 100644
--- a/chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc
@@ -145,14 +145,21 @@ TEST(ManagePasswordsViewUtilTest, GetManagePasswordsDialogTitleText) {
}
}
-TEST(ManagePasswordsViewUtilTest,
- GetAccountChooserDialogTitleTextAndLinkRangeSmartLockUsers) {
+// The parameter is |many_accounts| passed to
+// GetAccountChooserDialogTitleTextAndLinkRange
+class AccountChooserDialogTitleTest : public ::testing::TestWithParam<bool> {
+};
+
+TEST_P(AccountChooserDialogTitleTest,
+ GetAccountChooserDialogTitleTextAndLinkRangeSmartLockUsers) {
base::string16 branding =
l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK);
base::string16 title;
gfx::Range title_link_range;
GetAccountChooserDialogTitleTextAndLinkRange(
- true /* is_smartlock_branding_enabled */, &title, &title_link_range);
+ true /* is_smartlock_branding_enabled */,
+ GetParam(),
+ &title, &title_link_range);
// Check that branding string is a part of a title.
EXPECT_LT(title.find(branding, 0), title.size());
@@ -162,15 +169,20 @@ TEST(ManagePasswordsViewUtilTest,
EXPECT_NE(0U, title_link_range.end());
}
-TEST(ManagePasswordsViewUtilTest,
- GetAccountChooserDialogTitleTextAndLinkRangeNonSmartLockUsers) {
+TEST_P(AccountChooserDialogTitleTest,
+ GetAccountChooserDialogTitleTextAndLinkRangeNonSmartLockUsers) {
base::string16 branding =
l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK);
base::string16 title;
gfx::Range title_link_range;
GetAccountChooserDialogTitleTextAndLinkRange(
- false /* is_smartlock_branding_enabled */, &title, &title_link_range);
+ false /* is_smartlock_branding_enabled */,
+ GetParam(),
+ &title, &title_link_range);
EXPECT_GE(title.find(branding, 0), title.size());
EXPECT_EQ(0U, title_link_range.start());
EXPECT_EQ(0U, title_link_range.end());
}
+
+INSTANTIATE_TEST_CASE_P(, AccountChooserDialogTitleTest,
+ ::testing::Bool());

Powered by Google App Engine
This is Rietveld 408576698