| 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 <utility> | 10 #include <utility> |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // 0 or 1 server profile according to the parameters. | 163 // 0 or 1 server profile according to the parameters. |
| 164 void RecreateCreditCards(bool include_local_credit_card, | 164 void RecreateCreditCards(bool include_local_credit_card, |
| 165 bool include_masked_server_credit_card, | 165 bool include_masked_server_credit_card, |
| 166 bool include_full_server_credit_card) { | 166 bool include_full_server_credit_card) { |
| 167 local_credit_cards_.clear(); | 167 local_credit_cards_.clear(); |
| 168 server_credit_cards_.clear(); | 168 server_credit_cards_.clear(); |
| 169 if (include_local_credit_card) { | 169 if (include_local_credit_card) { |
| 170 std::unique_ptr<CreditCard> credit_card = base::MakeUnique<CreditCard>( | 170 std::unique_ptr<CreditCard> credit_card = base::MakeUnique<CreditCard>( |
| 171 "10000000-0000-0000-0000-000000000001", std::string()); | 171 "10000000-0000-0000-0000-000000000001", std::string()); |
| 172 test::SetCreditCardInfo(credit_card.get(), nullptr, "4111111111111111", | 172 test::SetCreditCardInfo(credit_card.get(), nullptr, "4111111111111111", |
| 173 "12", "24"); | 173 "12", "24", "1"); |
| 174 local_credit_cards_.push_back(std::move(credit_card)); | 174 local_credit_cards_.push_back(std::move(credit_card)); |
| 175 } | 175 } |
| 176 if (include_masked_server_credit_card) { | 176 if (include_masked_server_credit_card) { |
| 177 std::unique_ptr<CreditCard> credit_card = base::MakeUnique<CreditCard>( | 177 std::unique_ptr<CreditCard> credit_card = base::MakeUnique<CreditCard>( |
| 178 CreditCard::MASKED_SERVER_CARD, "server_id"); | 178 CreditCard::MASKED_SERVER_CARD, "server_id"); |
| 179 credit_card->set_guid("10000000-0000-0000-0000-000000000002"); | 179 credit_card->set_guid("10000000-0000-0000-0000-000000000002"); |
| 180 credit_card->SetNetworkForMaskedCard(kDiscoverCard); | 180 credit_card->SetNetworkForMaskedCard(kDiscoverCard); |
| 181 server_credit_cards_.push_back(std::move(credit_card)); | 181 server_credit_cards_.push_back(std::move(credit_card)); |
| 182 } | 182 } |
| 183 if (include_full_server_credit_card) { | 183 if (include_full_server_credit_card) { |
| (...skipping 4990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5174 ukm::UkmServiceTestingHarness ukm_service_test_harness; | 5174 ukm::UkmServiceTestingHarness ukm_service_test_harness; |
| 5175 GURL url("https://www.google.com"); | 5175 GURL url("https://www.google.com"); |
| 5176 std::vector<std::pair<const char*, int>> metrics = {{"metric", 1}}; | 5176 std::vector<std::pair<const char*, int>> metrics = {{"metric", 1}}; |
| 5177 | 5177 |
| 5178 EXPECT_FALSE(AutofillMetrics::LogUkm( | 5178 EXPECT_FALSE(AutofillMetrics::LogUkm( |
| 5179 ukm_service_test_harness.test_ukm_service(), url, "test_ukm", metrics)); | 5179 ukm_service_test_harness.test_ukm_service(), url, "test_ukm", metrics)); |
| 5180 EXPECT_EQ(0U, ukm_service_test_harness.test_ukm_service()->sources_count()); | 5180 EXPECT_EQ(0U, ukm_service_test_harness.test_ukm_service()->sources_count()); |
| 5181 } | 5181 } |
| 5182 | 5182 |
| 5183 } // namespace autofill | 5183 } // namespace autofill |
| OLD | NEW |