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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_view_utils_unittest.cc

Issue 1776883004: Change the title of the password bubble for Android credentials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_view_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" 5 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 false, PasswordTittleType::SAVE_ACCOUNT, "this site", 0, 0}, 73 false, PasswordTittleType::SAVE_ACCOUNT, "this site", 0, 0},
74 {"http://example.com/landing", "http://example.com/login#form?value=3", 74 {"http://example.com/landing", "http://example.com/login#form?value=3",
75 true, PasswordTittleType::SAVE_ACCOUNT, "this site", 12, 29}, 75 true, PasswordTittleType::SAVE_ACCOUNT, "this site", 12, 29},
76 76
77 // Different subdomains, federated credential. 77 // Different subdomains, federated credential.
78 {"https://a.example.com/landing", 78 {"https://a.example.com/landing",
79 "https://b.example.com/login#form?value=3", false, 79 "https://b.example.com/login#form?value=3", false,
80 PasswordTittleType::SAVE_ACCOUNT, "this site", 0, 0}, 80 PasswordTittleType::SAVE_ACCOUNT, "this site", 0, 0},
81 {"https://a.example.com/landing", 81 {"https://a.example.com/landing",
82 "https://b.example.com/login#form?value=3", true, 82 "https://b.example.com/login#form?value=3", true,
83 PasswordTittleType::SAVE_ACCOUNT, "this site", 12, 29}}; 83 PasswordTittleType::SAVE_ACCOUNT, "this site", 12, 29},
84
85 // Android update.
86 {"https://another.org", "android://m3HSJL1i83hdltRq0-o9czGb-8KJDKra4t_3JR"
87 "lnPKcjI8PZm6XBHXx6zG4UuMXaDEZjR1wuXDre9G9zvN7AQw==@com.example.android",
88 false, PasswordTittleType::SAVE_PASSWORD, "android://com.example.android",
89 0, 0},
90 {"https://another.org","android://m3HSJL1i83hdltRq0-o9czGb-8KJDKra4t_3JR"
91 "lnPKcjI8PZm6XBHXx6zG4UuMXaDEZjR1wuXDre9G9zvN7AQw==@com.example.android",
92 true, PasswordTittleType::SAVE_PASSWORD, "android://com.example.android",
93 12, 29},
94 };
84 95
85 } // namespace 96 } // namespace
86 97
87 // Test for GetSavePasswordDialogTitleTextAndLinkRange(). 98 // Test for GetSavePasswordDialogTitleTextAndLinkRange().
88 TEST(ManagePasswordsViewUtilTest, GetSavePasswordDialogTitleTextAndLinkRange) { 99 TEST(ManagePasswordsViewUtilTest, GetSavePasswordDialogTitleTextAndLinkRange) {
89 for (size_t i = 0; i < arraysize(kDomainsTestCases); ++i) { 100 for (size_t i = 0; i < arraysize(kDomainsTestCases); ++i) {
90 SCOPED_TRACE(testing::Message() << "user_visible_url = " 101 SCOPED_TRACE(testing::Message() << "user_visible_url = "
91 << kDomainsTestCases[i].user_visible_url 102 << kDomainsTestCases[i].user_visible_url
92 << ", form_origin_url = " 103 << ", form_origin_url = "
93 << kDomainsTestCases[i].form_origin_url); 104 << kDomainsTestCases[i].form_origin_url);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 base::string16 branding = 172 base::string16 branding =
162 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK); 173 l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SMART_LOCK);
163 base::string16 title; 174 base::string16 title;
164 gfx::Range title_link_range; 175 gfx::Range title_link_range;
165 GetAccountChooserDialogTitleTextAndLinkRange( 176 GetAccountChooserDialogTitleTextAndLinkRange(
166 false /* is_smartlock_branding_enabled */, &title, &title_link_range); 177 false /* is_smartlock_branding_enabled */, &title, &title_link_range);
167 EXPECT_GE(title.find(branding, 0), title.size()); 178 EXPECT_GE(title.find(branding, 0), title.size());
168 EXPECT_EQ(0U, title_link_range.start()); 179 EXPECT_EQ(0U, title_link_range.start());
169 EXPECT_EQ(0U, title_link_range.end()); 180 EXPECT_EQ(0U, title_link_range.end());
170 } 181 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_view_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698