| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 MOCK_METHOD0(OnPersonalDataChanged, void()); | 48 MOCK_METHOD0(OnPersonalDataChanged, void()); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // Unlike the base AutofillMetrics, exposes copy and assignment constructors, | 51 // Unlike the base AutofillMetrics, exposes copy and assignment constructors, |
| 52 // which are handy for briefer test code. The AutofillMetrics class is | 52 // which are handy for briefer test code. The AutofillMetrics class is |
| 53 // stateless, so this is safe. | 53 // stateless, so this is safe. |
| 54 class TestAutofillMetrics : public AutofillMetrics { | 54 class TestAutofillMetrics : public AutofillMetrics { |
| 55 public: | 55 public: |
| 56 TestAutofillMetrics() {} | 56 TestAutofillMetrics() {} |
| 57 virtual ~TestAutofillMetrics() {} | 57 ~TestAutofillMetrics() override {} |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 template <typename T> | 60 template <typename T> |
| 61 bool CompareElements(T* a, T* b) { | 61 bool CompareElements(T* a, T* b) { |
| 62 return a->Compare(*b) < 0; | 62 return a->Compare(*b) < 0; |
| 63 } | 63 } |
| 64 | 64 |
| 65 template <typename T> | 65 template <typename T> |
| 66 bool ElementsEqual(T* a, T* b) { | 66 bool ElementsEqual(T* a, T* b) { |
| 67 return a->Compare(*b) == 0; | 67 return a->Compare(*b) == 0; |
| (...skipping 2673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2741 | 2741 |
| 2742 prefs_->SetInteger(prefs::kAutofillMacAddressBookShowedCount, 4); | 2742 prefs_->SetInteger(prefs::kAutofillMacAddressBookShowedCount, 4); |
| 2743 EXPECT_TRUE(personal_data_->ShouldShowAccessAddressBookSuggestion(type)); | 2743 EXPECT_TRUE(personal_data_->ShouldShowAccessAddressBookSuggestion(type)); |
| 2744 | 2744 |
| 2745 prefs_->SetInteger(prefs::kAutofillMacAddressBookShowedCount, 6); | 2745 prefs_->SetInteger(prefs::kAutofillMacAddressBookShowedCount, 6); |
| 2746 EXPECT_FALSE(personal_data_->ShouldShowAccessAddressBookSuggestion(type)); | 2746 EXPECT_FALSE(personal_data_->ShouldShowAccessAddressBookSuggestion(type)); |
| 2747 } | 2747 } |
| 2748 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 2748 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 2749 | 2749 |
| 2750 } // namespace autofill | 2750 } // namespace autofill |
| OLD | NEW |