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" |
11 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" | 11 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" |
12 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
13 #include "components/password_manager/content/common/credential_manager_types.h" | |
14 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" | 13 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
| 14 #include "components/password_manager/core/common/credential_manager_types.h" |
15 #include "components/password_manager/core/common/password_manager_pref_names.h" | 15 #include "components/password_manager/core/common/password_manager_pref_names.h" |
16 #include "components/password_manager/core/common/password_manager_ui.h" | 16 #include "components/password_manager/core/common/password_manager_ui.h" |
17 #include "content/public/test/test_browser_thread_bundle.h" | 17 #include "content/public/test/test_browser_thread_bundle.h" |
18 #include "content/public/test/web_contents_tester.h" | 18 #include "content/public/test/web_contents_tester.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 const char kUIDismissalReasonMetric[] = "PasswordManager.UIDismissalReason"; | 21 const char kUIDismissalReasonMetric[] = "PasswordManager.UIDismissalReason"; |
22 | 22 |
23 class ManagePasswordsBubbleModelTest : public testing::Test { | 23 class ManagePasswordsBubbleModelTest : public testing::Test { |
24 public: | 24 public: |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |