| OLD | NEW |
| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 model_->OnAutoSignInToastTimeout(); | 285 model_->OnAutoSignInToastTimeout(); |
| 286 model_->OnBubbleHidden(); | 286 model_->OnBubbleHidden(); |
| 287 EXPECT_EQ(model_->dismissal_reason(), | 287 EXPECT_EQ(model_->dismissal_reason(), |
| 288 password_manager::metrics_util::AUTO_SIGNIN_TOAST_TIMEOUT); | 288 password_manager::metrics_util::AUTO_SIGNIN_TOAST_TIMEOUT); |
| 289 | 289 |
| 290 histogram_tester.ExpectUniqueSample( | 290 histogram_tester.ExpectUniqueSample( |
| 291 kUIDismissalReasonMetric, | 291 kUIDismissalReasonMetric, |
| 292 password_manager::metrics_util::AUTO_SIGNIN_TOAST_TIMEOUT, | 292 password_manager::metrics_util::AUTO_SIGNIN_TOAST_TIMEOUT, |
| 293 1); | 293 1); |
| 294 } | 294 } |
| 295 |
| 296 TEST_F(ManagePasswordsBubbleModelTest, PopupAutoSigninAndManagedBubble) { |
| 297 base::HistogramTester histogram_tester; |
| 298 PretendAutoSigningIn(); |
| 299 model_->OnAutoSignInToastTimeout(); |
| 300 model_->OnAutoSignInClicked(); |
| 301 EXPECT_EQ(model_->dismissal_reason(), |
| 302 password_manager::metrics_util::AUTO_SIGNIN_TOAST_CLICKED); |
| 303 model_->OnBubbleHidden(); |
| 304 |
| 305 EXPECT_TRUE(controller()->manage_accounts()); |
| 306 |
| 307 histogram_tester.ExpectUniqueSample( |
| 308 kUIDismissalReasonMetric, |
| 309 password_manager::metrics_util::AUTO_SIGNIN_TOAST_CLICKED, |
| 310 1); |
| 311 } |
| OLD | NEW |