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

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: Fixed autogenerated nits from trybot 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 2802 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « components/autofill/browser/autofill_manager.cc ('k') | components/autofill/browser/personal_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698