diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-20 18:55:36 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-20 18:55:36 +0000 |
commit | 9150291ada22937b7df835dd0e4c12f2d198c370 (patch) | |
tree | eb63cc2062f35be90401778e93cbc8b18a8a236f /chrome/browser/autofill/autofill_manager_unittest.cc | |
parent | 2d6b6e0fcb403ca0139756a99faf0b7036a2d758 (diff) | |
download | chromium_src-9150291ada22937b7df835dd0e4c12f2d198c370.zip chromium_src-9150291ada22937b7df835dd0e4c12f2d198c370.tar.gz chromium_src-9150291ada22937b7df835dd0e4c12f2d198c370.tar.bz2 |
Autofill profile pop-up should trigger for mouse double-clicks
Removes the cancellation logic for separated AutoFill and Autocomplete. This is no longer needed. The recent refactoring of the popup handling causes this logic to always hit the "cancel" scenario and thus return only Autocomplete suggestions and never AutoFill suggestions. But in fact, we get the Autocomplete-only results in the correct cases by virtue of the field type queried.
BUG=54875
TEST=AutoFillManagerTest.GetFieldSuggestions*
Review URL: http://codereview.chromium.org/3405015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59950 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_manager_unittest.cc')
-rw-r--r-- | chrome/browser/autofill/autofill_manager_unittest.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc index 7d78a9b..c84d482 100644 --- a/chrome/browser/autofill/autofill_manager_unittest.cc +++ b/chrome/browser/autofill/autofill_manager_unittest.cc @@ -662,28 +662,33 @@ TEST_F(AutoFillManagerTest, GetFieldSuggestionsForAutocompleteOnly) { // The page ID sent to the AutoFillManager from the RenderView, used to send // an IPC message back to the renderer. const int kPageID = 1; - const int kAlternatePageID = 0; webkit_glue::FormField field; autofill_unittest::CreateTestFormField( - "First Name", "firstname", "", "text", &field); - EXPECT_TRUE(autofill_manager_->GetAutoFillSuggestions(kPageID, true, field)); + "Some Field", "somefield", "", "text", &field); + EXPECT_FALSE(autofill_manager_->GetAutoFillSuggestions(kPageID, true, field)); // No suggestions provided, so send an empty vector as the results. // This triggers the combined message send. // In this case, we're simulating a cancel of Autocomplete with a different // page ID and an empty vector of suggestions. - rvh()->AutocompleteSuggestionsReturned(kAlternatePageID, - std::vector<string16>()); + std::vector<string16> suggestions; + suggestions.push_back(ASCIIToUTF16("one")); + suggestions.push_back(ASCIIToUTF16("two")); + rvh()->AutocompleteSuggestionsReturned(kPageID, suggestions); // Test that we sent the right message to the renderer. int page_id = 0; std::vector<string16> values; std::vector<string16> labels; EXPECT_TRUE(GetAutoFillSuggestionsMessage(&page_id, &values, &labels)); - EXPECT_EQ(kAlternatePageID, page_id); - ASSERT_EQ(0U, values.size()); - ASSERT_EQ(0U, labels.size()); + EXPECT_EQ(kPageID, page_id); + ASSERT_EQ(2U, values.size()); + ASSERT_EQ(2U, labels.size()); + EXPECT_EQ(ASCIIToUTF16("one"), values[0]); + EXPECT_EQ(string16(), labels[0]); + EXPECT_EQ(ASCIIToUTF16("two"), values[1]); + EXPECT_EQ(string16(), labels[1]); } TEST_F(AutoFillManagerTest, GetFieldSuggestionsWithDuplicateValues) { |