| 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 "components/autofill/core/browser/autofill_save_card_infobar_delegate_m
obile.h" | 5 #include "components/autofill/core/browser/autofill_save_card_infobar_delegate_m
obile.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/test/histogram_tester.h" | 10 #include "base/test/histogram_tester.h" |
| 11 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 11 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 12 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 12 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 13 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "components/autofill/core/browser/autofill_test_utils.h" | 15 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 16 #include "components/autofill/core/browser/personal_data_manager.h" | 16 #include "components/autofill/core/browser/personal_data_manager.h" |
| 17 #include "components/infobars/core/confirm_infobar_delegate.h" | 17 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 18 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 20 |
| 21 using testing::_; | 21 using testing::_; |
| 22 | 22 |
| 23 namespace autofill { | 23 namespace autofill { |
| 24 | 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 class TestPersonalDataManager : public PersonalDataManager { | 27 class TestPersonalDataManager : public PersonalDataManager { |
| 28 public: | 28 public: |
| 29 TestPersonalDataManager() : PersonalDataManager("en-US") {} | 29 TestPersonalDataManager() |
| 30 : PersonalDataManager("en-US", nullptr /* ukm_service */) {} |
| 30 | 31 |
| 31 using PersonalDataManager::set_database; | 32 using PersonalDataManager::set_database; |
| 32 using PersonalDataManager::SetPrefService; | 33 using PersonalDataManager::SetPrefService; |
| 33 | 34 |
| 34 // Overridden to avoid a trip to the database. | 35 // Overridden to avoid a trip to the database. |
| 35 void LoadProfiles() override {} | 36 void LoadProfiles() override {} |
| 36 void LoadCreditCards() override {} | 37 void LoadCreditCards() override {} |
| 37 | 38 |
| 38 MOCK_METHOD1(SaveImportedCreditCard, | 39 MOCK_METHOD1(SaveImportedCreditCard, |
| 39 std::string(const CreditCard& imported_credit_card)); | 40 std::string(const CreditCard& imported_credit_card)); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 CreateDelegate(/* is_uploading= */ true)); | 200 CreateDelegate(/* is_uploading= */ true)); |
| 200 | 201 |
| 201 base::HistogramTester histogram_tester; | 202 base::HistogramTester histogram_tester; |
| 202 infobar.reset(); | 203 infobar.reset(); |
| 203 histogram_tester.ExpectUniqueSample("Autofill.CreditCardInfoBar.Server", | 204 histogram_tester.ExpectUniqueSample("Autofill.CreditCardInfoBar.Server", |
| 204 AutofillMetrics::INFOBAR_IGNORED, 1); | 205 AutofillMetrics::INFOBAR_IGNORED, 1); |
| 205 } | 206 } |
| 206 } | 207 } |
| 207 | 208 |
| 208 } // namespace autofill | 209 } // namespace autofill |
| OLD | NEW |