| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/core/browser/autofill_metrics.h" | 5 #include "components/autofill/core/browser/autofill_metrics.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 using base::TimeTicks; | 45 using base::TimeTicks; |
| 46 using rappor::TestRapporServiceImpl; | 46 using rappor::TestRapporServiceImpl; |
| 47 using ::testing::ElementsAre; | 47 using ::testing::ElementsAre; |
| 48 | 48 |
| 49 namespace autofill { | 49 namespace autofill { |
| 50 namespace { | 50 namespace { |
| 51 | 51 |
| 52 class TestPersonalDataManager : public PersonalDataManager { | 52 class TestPersonalDataManager : public PersonalDataManager { |
| 53 public: | 53 public: |
| 54 TestPersonalDataManager() | 54 TestPersonalDataManager() |
| 55 : PersonalDataManager("en-US"), | 55 : PersonalDataManager("en-US", nullptr /* ukm_service */), |
| 56 autofill_enabled_(true) { | 56 autofill_enabled_(true) { |
| 57 CreateTestAutofillProfiles(&web_profiles_); | 57 CreateTestAutofillProfiles(&web_profiles_); |
| 58 } | 58 } |
| 59 | 59 |
| 60 using PersonalDataManager::set_account_tracker; | 60 using PersonalDataManager::set_account_tracker; |
| 61 using PersonalDataManager::set_signin_manager; | 61 using PersonalDataManager::set_signin_manager; |
| 62 using PersonalDataManager::set_database; | 62 using PersonalDataManager::set_database; |
| 63 using PersonalDataManager::SetPrefService; | 63 using PersonalDataManager::SetPrefService; |
| 64 | 64 |
| 65 // Overridden to avoid a trip to the database. This should be a no-op except | 65 // Overridden to avoid a trip to the database. This should be a no-op except |
| (...skipping 4268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4334 AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 1); | 4334 AutofillMetrics::FORM_EVENT_NO_SUGGESTION_SUBMITTED_ONCE, 1); |
| 4335 // Check that the nonsecure histogram was not recorded. ExpectBucketCount() | 4335 // Check that the nonsecure histogram was not recorded. ExpectBucketCount() |
| 4336 // can't be used here because it expects the histogram to exist. | 4336 // can't be used here because it expects the histogram to exist. |
| 4337 EXPECT_EQ( | 4337 EXPECT_EQ( |
| 4338 0, histograms.GetTotalCountsForPrefix("Autofill.FormEvents.CreditCard") | 4338 0, histograms.GetTotalCountsForPrefix("Autofill.FormEvents.CreditCard") |
| 4339 ["Autofill.FormEvents.CreditCard.OnNonsecurePage"]); | 4339 ["Autofill.FormEvents.CreditCard.OnNonsecurePage"]); |
| 4340 } | 4340 } |
| 4341 } | 4341 } |
| 4342 | 4342 |
| 4343 } // namespace autofill | 4343 } // namespace autofill |
| OLD | NEW |