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

Side by Side Diff: chrome/browser/autofill/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: Rebased 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 2685 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = PrefServiceFromBrowserContext(profile()); 2705 PrefService* prefs = PrefServiceFromBrowserContext(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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
3220 3221
3221 FormData form; 3222 FormData form;
3222 CreateTestAddressFormData(&form); 3223 CreateTestAddressFormData(&form);
3223 std::vector<FormData> forms(1, form); 3224 std::vector<FormData> forms(1, form);
3224 FormsSeen(forms); 3225 FormsSeen(forms);
3225 const FormFieldData& field = form.fields[0]; 3226 const FormFieldData& field = form.fields[0];
3226 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() 3227 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery()
3227 3228
3228 autofill_manager_->SetExternalDelegate(NULL); 3229 autofill_manager_->SetExternalDelegate(NULL);
3229 } 3230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698