Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: components/autofill/browser/autofill_manager_unittest.cc

Issue 12282004: Added personal_data_manager android implementation for auto-populating auto-fill on android builds … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698