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

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

Issue 148413002: Add "previewing on hover" support for single-field autocomplete input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and update code as per Ilya's comments Created 6 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 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 fc0b140ee472413011cb1ea6f6b44a617178b31d..edb4aa0e94f27830555fd84f6caf879283976213 100644
--- a/components/autofill/content/browser/content_autofill_driver_unittest.cc
+++ b/components/autofill/content/browser/content_autofill_driver_unittest.cc
@@ -157,8 +157,12 @@ class ContentAutofillDriverTest : public ChromeRenderViewHostTestHarness {
return false;
Tuple1<base::string16> autofill_param;
switch (messageID) {
- case AutofillMsg_SetNodeText::ID:
- if (!AutofillMsg_SetNodeText::Read(message, &autofill_param))
+ case AutofillMsg_FillFieldWithValue::ID:
+ if (!AutofillMsg_FillFieldWithValue::Read(message, &autofill_param))
+ return false;
+ break;
+ case AutofillMsg_PreviewFieldWithValue::ID:
+ if (!AutofillMsg_PreviewFieldWithValue::Read(message, &autofill_param))
return false;
break;
case AutofillMsg_AcceptDataListSuggestion::ID:
@@ -310,12 +314,23 @@ TEST_F(ContentAutofillDriverTest, ClearPreviewedFormSentToRenderer) {
EXPECT_TRUE(HasMessageMatchingID(AutofillMsg_ClearPreviewedForm::ID));
}
-TEST_F(ContentAutofillDriverTest, SetNodeText) {
+TEST_F(ContentAutofillDriverTest, FillFieldWithValue) {
base::string16 input_value(base::ASCIIToUTF16("barqux"));
base::string16 output_value;
- driver_->RendererShouldSetNodeText(input_value);
- EXPECT_TRUE(
- GetString16FromMessageWithID(AutofillMsg_SetNodeText::ID, &output_value));
+
+ driver_->RendererShouldFillFieldWithValue(input_value);
+ EXPECT_TRUE(GetString16FromMessageWithID(AutofillMsg_FillFieldWithValue::ID,
+ &output_value));
+ EXPECT_EQ(input_value, output_value);
+}
+
+TEST_F(ContentAutofillDriverTest, PreviewFieldWithValue) {
+ base::string16 input_value(base::ASCIIToUTF16("barqux"));
+ base::string16 output_value;
+ driver_->RendererShouldPreviewFieldWithValue(input_value);
+ EXPECT_TRUE(GetString16FromMessageWithID(
+ AutofillMsg_PreviewFieldWithValue::ID,
+ &output_value));
EXPECT_EQ(input_value, 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