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

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

Issue 6650014: Autofill extend profiles to include multi-valued fields, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit Created 9 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
« no previous file with comments | « chrome/browser/autofill/address.cc ('k') | chrome/browser/autofill/autofill_profile.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 5 #include <vector>
6 6
7 #include "base/ref_counted.h" 7 #include "base/ref_counted.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "base/scoped_vector.h" 9 #include "base/scoped_vector.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 665
666 // Test that we cull duplicate profile suggestions. 666 // Test that we cull duplicate profile suggestions.
667 TEST_F(AutofillManagerTest, GetProfileSuggestionsWithDuplicates) { 667 TEST_F(AutofillManagerTest, GetProfileSuggestionsWithDuplicates) {
668 // Set up our form data. 668 // Set up our form data.
669 FormData form; 669 FormData form;
670 CreateTestAddressFormData(&form); 670 CreateTestAddressFormData(&form);
671 std::vector<FormData> forms(1, form); 671 std::vector<FormData> forms(1, form);
672 FormsSeen(forms); 672 FormsSeen(forms);
673 673
674 // Add a duplicate profile. 674 // Add a duplicate profile.
675 AutoFillProfile* duplicate_profile = static_cast<AutoFillProfile*>( 675 AutoFillProfile* duplicate_profile =
676 autofill_manager_->GetProfileWithGUID( 676 new AutoFillProfile(
677 "00000000-0000-0000-0000-000000000001")->Clone()); 677 *(autofill_manager_->GetProfileWithGUID(
678 "00000000-0000-0000-0000-000000000001")));
678 autofill_manager_->AddProfile(duplicate_profile); 679 autofill_manager_->AddProfile(duplicate_profile);
679 680
680 const FormField& field = form.fields[0]; 681 const FormField& field = form.fields[0];
681 GetAutoFillSuggestions(form, field); 682 GetAutoFillSuggestions(form, field);
682 683
683 // No suggestions provided, so send an empty vector as the results. 684 // No suggestions provided, so send an empty vector as the results.
684 // This triggers the combined message send. 685 // This triggers the combined message send.
685 AutocompleteSuggestionsReturned(std::vector<string16>()); 686 AutocompleteSuggestionsReturned(std::vector<string16>());
686 687
687 // Test that we sent the right message to the renderer. 688 // Test that we sent the right message to the renderer.
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 #else 1747 #else
1747 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( 1748 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean(
1748 prefs::kAutoFillAuxiliaryProfilesEnabled)); 1749 prefs::kAutoFillAuxiliaryProfilesEnabled));
1749 profile()->GetPrefs()->SetBoolean( 1750 profile()->GetPrefs()->SetBoolean(
1750 prefs::kAutoFillAuxiliaryProfilesEnabled, true); 1751 prefs::kAutoFillAuxiliaryProfilesEnabled, true);
1751 profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled); 1752 profile()->GetPrefs()->ClearPref(prefs::kAutoFillAuxiliaryProfilesEnabled);
1752 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean( 1753 ASSERT_FALSE(profile()->GetPrefs()->GetBoolean(
1753 prefs::kAutoFillAuxiliaryProfilesEnabled)); 1754 prefs::kAutoFillAuxiliaryProfilesEnabled));
1754 #endif 1755 #endif
1755 } 1756 }
OLDNEW
« no previous file with comments | « chrome/browser/autofill/address.cc ('k') | chrome/browser/autofill/autofill_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698