diff options
author | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-25 23:53:53 +0000 |
---|---|---|
committer | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-25 23:53:53 +0000 |
commit | 9f3214478d7e077ffdd4cd78998596b1c7484713 (patch) | |
tree | 8467fa5ef12c3d762120f5a297b5abaa82c514a7 /chrome/browser/autofill/personal_data_manager_unittest.cc | |
parent | d7f67f800d40a27ac14106522b61665767e6ad51 (diff) | |
download | chromium_src-9f3214478d7e077ffdd4cd78998596b1c7484713.zip chromium_src-9f3214478d7e077ffdd4cd78998596b1c7484713.tar.gz chromium_src-9f3214478d7e077ffdd4cd78998596b1c7484713.tar.bz2 |
Never allow empty preview entries. As some data is always present (we drop completely empty profiles),
display this data in preview if name and first line of address is not available.
TEST=in the bug + unit-test
BUG=50320
Review URL: http://codereview.chromium.org/3806008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63806 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/personal_data_manager_unittest.cc')
-rw-r--r-- | chrome/browser/autofill/personal_data_manager_unittest.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/autofill/personal_data_manager_unittest.cc b/chrome/browser/autofill/personal_data_manager_unittest.cc index 267933f..ef4f4a5 100644 --- a/chrome/browser/autofill/personal_data_manager_unittest.cc +++ b/chrome/browser/autofill/personal_data_manager_unittest.cc @@ -501,8 +501,11 @@ TEST_F(PersonalDataManagerTest, Refresh) { profile0.set_unique_id(update[0].unique_id()); profile1.set_unique_id(update[1].unique_id()); - profile0.set_label(update[0].Label()); - profile1.set_label(update[1].Label()); + // Labels depend on other profiles in the list - update labels manually/ + std::vector<AutoFillProfile *> profile_pointers; + profile_pointers.push_back(&profile0); + profile_pointers.push_back(&profile1); + AutoFillProfile::AdjustInferredLabels(&profile_pointers); // Wait for the refresh. EXPECT_CALL(personal_data_observer_, @@ -521,6 +524,10 @@ TEST_F(PersonalDataManagerTest, Refresh) { "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", "32801", "US", "19482937549", "13502849239"); + // Adjust all labels. + profile_pointers.push_back(profile2.get()); + AutoFillProfile::AdjustInferredLabels(&profile_pointers); + WebDataService* wds = profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); ASSERT_TRUE(wds); wds->AddAutoFillProfile(*profile2.get()); |