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 2685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2696 // Simulate form submission. We should not call into the PDM to try to save | 2696 // Simulate form submission. We should not call into the PDM to try to save |
2697 // the filled data, since the filled form is effectively missing an address. | 2697 // the filled data, since the filled form is effectively missing an address. |
2698 EXPECT_CALL(personal_data_, SaveImportedProfile(::testing::_)).Times(0); | 2698 EXPECT_CALL(personal_data_, SaveImportedProfile(::testing::_)).Times(0); |
2699 FormSubmitted(results); | 2699 FormSubmitted(results); |
2700 } | 2700 } |
2701 | 2701 |
2702 // Checks that resetting the auxiliary profile enabled preference does the right | 2702 // Checks that resetting the auxiliary profile enabled preference does the right |
2703 // thing on all platforms. | 2703 // thing on all platforms. |
2704 TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) { | 2704 TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) { |
2705 PrefService* prefs = components::UserPrefs::Get(profile()); | 2705 PrefService* prefs = components::UserPrefs::Get(profile()); |
2706 #if defined(OS_MACOSX) | 2706 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
2707 // Auxiliary profiles is implemented on Mac only. It enables Mac Address | 2707 // Auxiliary profiles is implemented on Mac and Android only. |
2708 // Book integration. | 2708 // OSX: enables Mac Address Book integration. |
| 2709 // Android: enables integration with user's contact profile. |
2709 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2710 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
2710 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); | 2711 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); |
2711 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); | 2712 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); |
2712 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2713 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
2713 #else | 2714 #else |
2714 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2715 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
2715 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, true); | 2716 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, true); |
2716 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); | 2717 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); |
2717 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); | 2718 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); |
2718 #endif | 2719 #endif |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3219 | 3220 |
3220 FormData form; | 3221 FormData form; |
3221 CreateTestAddressFormData(&form); | 3222 CreateTestAddressFormData(&form); |
3222 std::vector<FormData> forms(1, form); | 3223 std::vector<FormData> forms(1, form); |
3223 FormsSeen(forms); | 3224 FormsSeen(forms); |
3224 const FormFieldData& field = form.fields[0]; | 3225 const FormFieldData& field = form.fields[0]; |
3225 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3226 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
3226 | 3227 |
3227 autofill_manager_->SetExternalDelegate(NULL); | 3228 autofill_manager_->SetExternalDelegate(NULL); |
3228 } | 3229 } |
OLD | NEW |