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

Unified Diff: components/autofill/content/browser/content_autofill_driver_unittest.cc

Issue 1208133002: [Autofill/Autocomplete Feature] Substring matching instead of prefix matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added |match_start| usage. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/content/browser/content_autofill_driver_unittest.cc
diff --git a/components/autofill/content/browser/content_autofill_driver_unittest.cc b/components/autofill/content/browser/content_autofill_driver_unittest.cc
index 31ffba8b15d569ff8e0a7682bb13eadc9f0b5019..18f08ad362a20940ec8bf94f8ce7a3c0a6201515 100644
--- a/components/autofill/content/browser/content_autofill_driver_unittest.cc
+++ b/components/autofill/content/browser/content_autofill_driver_unittest.cc
@@ -161,10 +161,17 @@ class ContentAutofillDriverTest : public content::RenderViewHostTestHarness {
if (!AutofillMsg_FillFieldWithValue::Read(message, &autofill_param))
return false;
break;
- case AutofillMsg_PreviewFieldWithValue::ID:
- if (!AutofillMsg_PreviewFieldWithValue::Read(message, &autofill_param))
+ case AutofillMsg_PreviewFieldWithValue::ID: {
+ base::Tuple<base::string16, int> autofill_param_preview;
+ if (AutofillMsg_PreviewFieldWithValue::Read(message,
+ &autofill_param_preview)) {
+ if (value)
+ *value = base::get<0>(autofill_param);
+ process()->sink().ClearMessages();
+ return true;
+ }
return false;
- break;
+ } break;
case AutofillMsg_AcceptDataListSuggestion::ID:
if (!AutofillMsg_AcceptDataListSuggestion::Read(message,
&autofill_param))
@@ -313,7 +320,8 @@ TEST_F(ContentAutofillDriverTest, FillFieldWithValue) {
TEST_F(ContentAutofillDriverTest, PreviewFieldWithValue) {
base::string16 input_value(base::ASCIIToUTF16("barqux"));
base::string16 output_value;
- driver_->RendererShouldPreviewFieldWithValue(input_value);
+ size_t match_start = 0;
+ driver_->RendererShouldPreviewFieldWithValue(input_value, match_start);
EXPECT_TRUE(GetString16FromMessageWithID(
AutofillMsg_PreviewFieldWithValue::ID,
&output_value));
« no previous file with comments | « components/autofill/content/browser/content_autofill_driver.cc ('k') | components/autofill/content/common/autofill_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698