| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 // Simulate form submission. We should not call into the PDM to try to save | 2729 // Simulate form submission. We should not call into the PDM to try to save |
| 2730 // the filled data, since the filled form is effectively missing an address. | 2730 // the filled data, since the filled form is effectively missing an address. |
| 2731 EXPECT_CALL(personal_data_, SaveImportedProfile(::testing::_)).Times(0); | 2731 EXPECT_CALL(personal_data_, SaveImportedProfile(::testing::_)).Times(0); |
| 2732 FormSubmitted(results); | 2732 FormSubmitted(results); |
| 2733 } | 2733 } |
| 2734 | 2734 |
| 2735 // Checks that resetting the auxiliary profile enabled preference does the right | 2735 // Checks that resetting the auxiliary profile enabled preference does the right |
| 2736 // thing on all platforms. | 2736 // thing on all platforms. |
| 2737 TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) { | 2737 TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) { |
| 2738 PrefService* prefs = components::UserPrefs::Get(profile()); | 2738 PrefService* prefs = components::UserPrefs::Get(profile()); |
| 2739 #if defined(OS_MACOSX) | 2739 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 2740 // Auxiliary profiles is implemented on Mac only. It enables Mac Address | 2740 // Auxiliary profiles is implemented on Mac and Android only. |
| 2741 // Book integration. | 2741 // OSX: enables Mac Address Book integration. |
| 2742 // Android: enables integration with user's contact profile. |
| 2742 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2743 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
| 2743 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); | 2744 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); |
| 2744 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); | 2745 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); |
| 2745 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2746 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
| 2746 #else | 2747 #else |
| 2747 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2748 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
| 2748 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, true); | 2749 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, true); |
| 2749 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); | 2750 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); |
| 2750 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2751 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
| 2751 #endif | 2752 #endif |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3252 | 3253 |
| 3253 FormData form; | 3254 FormData form; |
| 3254 CreateTestAddressFormData(&form); | 3255 CreateTestAddressFormData(&form); |
| 3255 std::vector<FormData> forms(1, form); | 3256 std::vector<FormData> forms(1, form); |
| 3256 FormsSeen(forms); | 3257 FormsSeen(forms); |
| 3257 const FormFieldData& field = form.fields[0]; | 3258 const FormFieldData& field = form.fields[0]; |
| 3258 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3259 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
| 3259 | 3260 |
| 3260 autofill_manager_->SetExternalDelegate(NULL); | 3261 autofill_manager_->SetExternalDelegate(NULL); |
| 3261 } | 3262 } |
| OLD | NEW |