| 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 #import "ios/chrome/browser/autofill/autofill_controller.h" | 5 #import "ios/chrome/browser/autofill/autofill_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 "</form>"; | 114 "</form>"; |
| 115 | 115 |
| 116 // Experiment preference key. | 116 // Experiment preference key. |
| 117 NSString* const kAutofillVisible = @"AutofillVisible"; | 117 NSString* const kAutofillVisible = @"AutofillVisible"; |
| 118 | 118 |
| 119 // FAIL if a field with the supplied |name| and |fieldType| is not present on | 119 // FAIL if a field with the supplied |name| and |fieldType| is not present on |
| 120 // the |form|. | 120 // the |form|. |
| 121 void CheckField(const FormStructure& form, | 121 void CheckField(const FormStructure& form, |
| 122 ServerFieldType fieldType, | 122 ServerFieldType fieldType, |
| 123 const char* name) { | 123 const char* name) { |
| 124 for (const AutofillField* field : form) { | 124 for (const auto& field : form) { |
| 125 if (field->heuristic_type() == fieldType) { | 125 if (field->heuristic_type() == fieldType) { |
| 126 EXPECT_EQ(base::UTF8ToUTF16(name), field->unique_name()); | 126 EXPECT_EQ(base::UTF8ToUTF16(name), field->unique_name()); |
| 127 return; | 127 return; |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 FAIL() << "Missing field " << name; | 130 FAIL() << "Missing field " << name; |
| 131 } | 131 } |
| 132 | 132 |
| 133 // WebDataServiceConsumer for receving vectors of strings and making them | 133 // WebDataServiceConsumer for receving vectors of strings and making them |
| 134 // available to tests. | 134 // available to tests. |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 EXPECT_EQ(base::UTF8ToUTF16("11"), | 578 EXPECT_EQ(base::UTF8ToUTF16("11"), |
| 579 credit_card.GetInfo(AutofillType(CREDIT_CARD_EXP_MONTH), "en-US")); | 579 credit_card.GetInfo(AutofillType(CREDIT_CARD_EXP_MONTH), "en-US")); |
| 580 EXPECT_EQ( | 580 EXPECT_EQ( |
| 581 base::UTF8ToUTF16("2999"), | 581 base::UTF8ToUTF16("2999"), |
| 582 credit_card.GetInfo(AutofillType(CREDIT_CARD_EXP_4_DIGIT_YEAR), "en-US")); | 582 credit_card.GetInfo(AutofillType(CREDIT_CARD_EXP_4_DIGIT_YEAR), "en-US")); |
| 583 }; | 583 }; |
| 584 | 584 |
| 585 } // namespace | 585 } // namespace |
| 586 | 586 |
| 587 } // namespace autofill | 587 } // namespace autofill |
| OLD | NEW |