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

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: Created 7 years, 10 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 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 // Simulate form submission. We should not call into the PDM to try to save 2698 // Simulate form submission. We should not call into the PDM to try to save
2699 // the filled data, since the filled form is effectively missing an address. 2699 // the filled data, since the filled form is effectively missing an address.
2700 EXPECT_CALL(personal_data_, SaveImportedProfile(::testing::_)).Times(0); 2700 EXPECT_CALL(personal_data_, SaveImportedProfile(::testing::_)).Times(0);
2701 FormSubmitted(results); 2701 FormSubmitted(results);
2702 } 2702 }
2703 2703
2704 // Checks that resetting the auxiliary profile enabled preference does the right 2704 // Checks that resetting the auxiliary profile enabled preference does the right
2705 // thing on all platforms. 2705 // thing on all platforms.
2706 TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) { 2706 TEST_F(AutofillManagerTest, AuxiliaryProfilesReset) {
2707 PrefServiceBase* prefs = PrefServiceBase::FromBrowserContext(profile()); 2707 PrefServiceBase* prefs = PrefServiceBase::FromBrowserContext(profile());
2708 #if defined(OS_MACOSX) 2708 #if defined(OS_MACOSX) || defined(OS_ANDROID)
2709 // Auxiliary profiles is implemented on Mac only. It enables Mac Address 2709 // Auxiliary profiles is implemented on Mac only. It enables Mac Address
aurimas (slooooooooow) 2013/02/15 19:16:13 Do these tests pass for Android? Should this comme
David Trainor- moved to gerrit 2013/02/19 19:03:13 Fix comment to say Android as well if we're adding
2710 // Book integration. 2710 // Book integration.
2711 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); 2711 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled));
2712 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); 2712 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false);
2713 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); 2713 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled);
2714 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); 2714 ASSERT_TRUE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled));
2715 #else 2715 #else
2716 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); 2716 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled));
2717 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, true); 2717 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, true);
2718 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled); 2718 prefs->ClearPref(prefs::kAutofillAuxiliaryProfilesEnabled);
2719 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled)); 2719 ASSERT_FALSE(prefs->GetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled));
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
3222 3222
3223 FormData form; 3223 FormData form;
3224 CreateTestAddressFormData(&form); 3224 CreateTestAddressFormData(&form);
3225 std::vector<FormData> forms(1, form); 3225 std::vector<FormData> forms(1, form);
3226 FormsSeen(forms); 3226 FormsSeen(forms);
3227 const FormFieldData& field = form.fields[0]; 3227 const FormFieldData& field = form.fields[0];
3228 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() 3228 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery()
3229 3229
3230 autofill_manager_->SetExternalDelegate(NULL); 3230 autofill_manager_->SetExternalDelegate(NULL);
3231 } 3231 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698