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

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

Issue 1162583003: Credential Management: Rename 'LocalCredential' to 'PasswordCredential' (2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@drop
Patch Set: Fix. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/metrics/histogram_samples.h" 5 #include "base/metrics/histogram_samples.h"
6 #include "base/prefs/pref_service.h" 6 #include "base/prefs/pref_service.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/test/histogram_tester.h" 8 #include "base/test/histogram_tester.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h"
10 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" 10 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 password_manager::metrics_util::CLICKED_UNBLACKLIST, 223 password_manager::metrics_util::CLICKED_UNBLACKLIST,
224 1); 224 1);
225 } 225 }
226 226
227 TEST_F(ManagePasswordsBubbleModelTest, ClickCredential) { 227 TEST_F(ManagePasswordsBubbleModelTest, ClickCredential) {
228 base::HistogramTester histogram_tester; 228 base::HistogramTester histogram_tester;
229 PretendCredentialsWaiting(); 229 PretendCredentialsWaiting();
230 EXPECT_FALSE(controller()->choose_credential()); 230 EXPECT_FALSE(controller()->choose_credential());
231 autofill::PasswordForm form; 231 autofill::PasswordForm form;
232 model_->OnChooseCredentials( 232 model_->OnChooseCredentials(
233 form, password_manager::CredentialType::CREDENTIAL_TYPE_LOCAL); 233 form, password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD);
234 model_->OnBubbleHidden(); 234 model_->OnBubbleHidden();
235 EXPECT_EQ(model_->dismissal_reason(), 235 EXPECT_EQ(model_->dismissal_reason(),
236 password_manager::metrics_util::CLICKED_CREDENTIAL); 236 password_manager::metrics_util::CLICKED_CREDENTIAL);
237 EXPECT_FALSE(controller()->saved_password()); 237 EXPECT_FALSE(controller()->saved_password());
238 EXPECT_FALSE(controller()->never_saved_password()); 238 EXPECT_FALSE(controller()->never_saved_password());
239 EXPECT_TRUE(controller()->choose_credential()); 239 EXPECT_TRUE(controller()->choose_credential());
240 240
241 histogram_tester.ExpectUniqueSample( 241 histogram_tester.ExpectUniqueSample(
242 kUIDismissalReasonMetric, 242 kUIDismissalReasonMetric,
243 password_manager::metrics_util::CLICKED_CREDENTIAL, 243 password_manager::metrics_util::CLICKED_CREDENTIAL,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 password_manager::metrics_util::AUTO_SIGNIN_TOAST_CLICKED); 302 password_manager::metrics_util::AUTO_SIGNIN_TOAST_CLICKED);
303 model_->OnBubbleHidden(); 303 model_->OnBubbleHidden();
304 304
305 EXPECT_TRUE(controller()->manage_accounts()); 305 EXPECT_TRUE(controller()->manage_accounts());
306 306
307 histogram_tester.ExpectUniqueSample( 307 histogram_tester.ExpectUniqueSample(
308 kUIDismissalReasonMetric, 308 kUIDismissalReasonMetric,
309 password_manager::metrics_util::AUTO_SIGNIN_TOAST_CLICKED, 309 password_manager::metrics_util::AUTO_SIGNIN_TOAST_CLICKED,
310 1); 310 1);
311 } 311 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698