| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 // Removes all existing credit cards and creates 0 or 1 local profiles and | 150 // Removes all existing credit cards and creates 0 or 1 local profiles and |
| 151 // 0 or 1 server profile according to the paramters. | 151 // 0 or 1 server profile according to the paramters. |
| 152 void RecreateCreditCards(bool include_local_credit_card, | 152 void RecreateCreditCards(bool include_local_credit_card, |
| 153 bool include_masked_server_credit_card, | 153 bool include_masked_server_credit_card, |
| 154 bool include_full_server_credit_card) { | 154 bool include_full_server_credit_card) { |
| 155 local_credit_cards_.clear(); | 155 local_credit_cards_.clear(); |
| 156 server_credit_cards_.clear(); | 156 server_credit_cards_.clear(); |
| 157 if (include_local_credit_card) { | 157 if (include_local_credit_card) { |
| 158 CreditCard* credit_card = | 158 CreditCard* credit_card = |
| 159 new CreditCard(base::ASCIIToUTF16("4111111111111111"), 12, 24); | 159 new CreditCard(base::ASCIIToUTF16("Alice"), |
| 160 base::ASCIIToUTF16("4111111111111111"), 12, 24); |
| 160 credit_card->set_guid("10000000-0000-0000-0000-000000000001"); | 161 credit_card->set_guid("10000000-0000-0000-0000-000000000001"); |
| 161 local_credit_cards_.push_back(credit_card); | 162 local_credit_cards_.push_back(credit_card); |
| 162 } | 163 } |
| 163 if (include_masked_server_credit_card) { | 164 if (include_masked_server_credit_card) { |
| 164 CreditCard* credit_card = new CreditCard( | 165 CreditCard* credit_card = new CreditCard( |
| 165 CreditCard::MASKED_SERVER_CARD, "server_id"); | 166 CreditCard::MASKED_SERVER_CARD, "server_id"); |
| 166 credit_card->set_guid("10000000-0000-0000-0000-000000000002"); | 167 credit_card->set_guid("10000000-0000-0000-0000-000000000002"); |
| 167 credit_card->SetTypeForMaskedCard(kDiscoverCard); | 168 credit_card->SetTypeForMaskedCard(kDiscoverCard); |
| 168 server_credit_cards_.push_back(credit_card); | 169 server_credit_cards_.push_back(credit_card); |
| 169 } | 170 } |
| (...skipping 3898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4068 EXPECT_THAT( | 4069 EXPECT_THAT( |
| 4069 histogram_tester.GetAllSamples("Autofill.ServerResponseHasDataForForm"), | 4070 histogram_tester.GetAllSamples("Autofill.ServerResponseHasDataForForm"), |
| 4070 ElementsAre(Bucket(true, 2))); | 4071 ElementsAre(Bucket(true, 2))); |
| 4071 | 4072 |
| 4072 // No RAPPOR metrics are logged in the case there is at least some server data | 4073 // No RAPPOR metrics are logged in the case there is at least some server data |
| 4073 // available for all forms. | 4074 // available for all forms. |
| 4074 EXPECT_EQ(0, rappor_service_.GetReportsCount()); | 4075 EXPECT_EQ(0, rappor_service_.GetReportsCount()); |
| 4075 } | 4076 } |
| 4076 | 4077 |
| 4077 } // namespace autofill | 4078 } // namespace autofill |
| OLD | NEW |