| 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> |
| 11 | 11 |
| 12 #include "base/feature_list.h" | 12 #include "base/feature_list.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/metrics/metrics_hashes.h" | 15 #include "base/metrics/metrics_hashes.h" |
| 16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 19 #include "base/test/histogram_tester.h" | 19 #include "base/test/histogram_tester.h" |
| 20 #include "base/test/scoped_feature_list.h" | 20 #include "base/test/scoped_feature_list.h" |
| 21 #include "base/test/scoped_task_environment.h" |
| 21 #include "base/test/user_action_tester.h" | 22 #include "base/test/user_action_tester.h" |
| 22 #include "base/time/time.h" | 23 #include "base/time/time.h" |
| 23 #include "components/autofill/core/browser/autofill_experiments.h" | 24 #include "components/autofill/core/browser/autofill_experiments.h" |
| 24 #include "components/autofill/core/browser/autofill_external_delegate.h" | 25 #include "components/autofill/core/browser/autofill_external_delegate.h" |
| 25 #include "components/autofill/core/browser/autofill_manager.h" | 26 #include "components/autofill/core/browser/autofill_manager.h" |
| 26 #include "components/autofill/core/browser/autofill_test_utils.h" | 27 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 27 #include "components/autofill/core/browser/payments/payments_client.h" | 28 #include "components/autofill/core/browser/payments/payments_client.h" |
| 28 #include "components/autofill/core/browser/personal_data_manager.h" | 29 #include "components/autofill/core/browser/personal_data_manager.h" |
| 29 #include "components/autofill/core/browser/popup_item_ids.h" | 30 #include "components/autofill/core/browser/popup_item_ids.h" |
| 30 #include "components/autofill/core/browser/test_autofill_client.h" | 31 #include "components/autofill/core/browser/test_autofill_client.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 public: | 327 public: |
| 327 ~AutofillMetricsTest() override; | 328 ~AutofillMetricsTest() override; |
| 328 | 329 |
| 329 void SetUp() override; | 330 void SetUp() override; |
| 330 void TearDown() override; | 331 void TearDown() override; |
| 331 | 332 |
| 332 protected: | 333 protected: |
| 333 void EnableWalletSync(); | 334 void EnableWalletSync(); |
| 334 void EnableUkmLogging(); | 335 void EnableUkmLogging(); |
| 335 | 336 |
| 336 base::MessageLoop message_loop_; | 337 base::test::ScopedTaskEnvironment scoped_task_environment_; |
| 337 TestAutofillClient autofill_client_; | 338 TestAutofillClient autofill_client_; |
| 338 std::unique_ptr<AccountTrackerService> account_tracker_; | 339 std::unique_ptr<AccountTrackerService> account_tracker_; |
| 339 std::unique_ptr<FakeSigninManagerBase> signin_manager_; | 340 std::unique_ptr<FakeSigninManagerBase> signin_manager_; |
| 340 std::unique_ptr<TestSigninClient> signin_client_; | 341 std::unique_ptr<TestSigninClient> signin_client_; |
| 341 std::unique_ptr<TestAutofillDriver> autofill_driver_; | 342 std::unique_ptr<TestAutofillDriver> autofill_driver_; |
| 342 std::unique_ptr<TestAutofillManager> autofill_manager_; | 343 std::unique_ptr<TestAutofillManager> autofill_manager_; |
| 343 std::unique_ptr<TestPersonalDataManager> personal_data_; | 344 std::unique_ptr<TestPersonalDataManager> personal_data_; |
| 344 std::unique_ptr<AutofillExternalDelegate> external_delegate_; | 345 std::unique_ptr<AutofillExternalDelegate> external_delegate_; |
| 345 base::test::ScopedFeatureList scoped_feature_list_; | 346 base::test::ScopedFeatureList scoped_feature_list_; |
| 346 }; | 347 }; |
| (...skipping 4348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4695 ukm::UkmServiceTestingHarness ukm_service_test_harness; | 4696 ukm::UkmServiceTestingHarness ukm_service_test_harness; |
| 4696 GURL url("https://www.google.com"); | 4697 GURL url("https://www.google.com"); |
| 4697 std::map<std::string, int> metrics = {{"metric", 1}}; | 4698 std::map<std::string, int> metrics = {{"metric", 1}}; |
| 4698 | 4699 |
| 4699 EXPECT_FALSE(AutofillMetrics::LogUkm( | 4700 EXPECT_FALSE(AutofillMetrics::LogUkm( |
| 4700 ukm_service_test_harness.test_ukm_service(), url, "test_ukm", metrics)); | 4701 ukm_service_test_harness.test_ukm_service(), url, "test_ukm", metrics)); |
| 4701 EXPECT_EQ(0U, ukm_service_test_harness.test_ukm_service()->sources_count()); | 4702 EXPECT_EQ(0U, ukm_service_test_harness.test_ukm_service()->sources_count()); |
| 4702 } | 4703 } |
| 4703 | 4704 |
| 4704 } // namespace autofill | 4705 } // namespace autofill |
| OLD | NEW |