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 2802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2813 // Simulate form submission. We should not call into the PDM to try to save | 2813 // Simulate form submission. We should not call into the PDM to try to save |
2814 // the filled data, since the filled form is effectively missing an address. | 2814 // the filled data, since the filled form is effectively missing an address. |
2815 EXPECT_CALL(personal_data_, SaveImportedProfile(::testing::_)).Times(0); | 2815 EXPECT_CALL(personal_data_, SaveImportedProfile(::testing::_)).Times(0); |
2816 FormSubmitted(results); | 2816 FormSubmitted(results); |
2817 } | 2817 } |
2818 | 2818 |
2819 // Checks that resetting the auxiliary profile enabled preference does the right | 2819 // Checks that resetting the auxiliary profile enabled preference does the right |
2820 // thing on all platforms. | 2820 // thing on all platforms. |
2821 TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) { | 2821 TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) { |
2822 PrefService* prefs = components::UserPrefs::Get(profile()); | 2822 PrefService* prefs = components::UserPrefs::Get(profile()); |
2823 #if defined(OS_MACOSX) | 2823 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
2824 // Auxiliary profiles is implemented on Mac only. It enables Mac Address | 2824 // Auxiliary profiles is implemented on Mac and Android only. |
2825 // Book integration. | 2825 // OSX: enables Mac Address Book integration. |
| 2826 // Android: enables integration with user's contact profile. |
2826 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2827 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
2827 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); | 2828 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); |
2828 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); | 2829 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); |
2829 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2830 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
2830 #else | 2831 #else |
2831 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2832 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
2832 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, true); | 2833 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, true); |
2833 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); | 2834 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); |
2834 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2835 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
2835 #endif | 2836 #endif |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3335 | 3336 |
3336 FormData form; | 3337 FormData form; |
3337 CreateTestAddressFormData(&form); | 3338 CreateTestAddressFormData(&form); |
3338 std::vector<FormData> forms(1, form); | 3339 std::vector<FormData> forms(1, form); |
3339 FormsSeen(forms); | 3340 FormsSeen(forms); |
3340 const FormFieldData& field = form.fields[0]; | 3341 const FormFieldData& field = form.fields[0]; |
3341 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3342 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
3342 | 3343 |
3343 autofill_manager_->SetExternalDelegate(NULL); | 3344 autofill_manager_->SetExternalDelegate(NULL); |
3344 } | 3345 } |
OLD | NEW |