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

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

Issue 208453002: Add "previewing on hover" support for password field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 edb4aa0e94f27830555fd84f6caf879283976213..3618587db0bd7dbe0876d9abea22ff3bae937e00 100644
--- a/components/autofill/content/browser/content_autofill_driver_unittest.cc
+++ b/components/autofill/content/browser/content_autofill_driver_unittest.cc
@@ -165,6 +165,10 @@ class ContentAutofillDriverTest : public ChromeRenderViewHostTestHarness {
if (!AutofillMsg_PreviewFieldWithValue::Read(message, &autofill_param))
return false;
break;
+ case AutofillMsg_PreviewPassword::ID:
+ if (!AutofillMsg_PreviewPassword::Read(message, &autofill_param))
+ return false;
+ break;
case AutofillMsg_AcceptDataListSuggestion::ID:
if (!AutofillMsg_AcceptDataListSuggestion::Read(message,
&autofill_param))
@@ -334,4 +338,13 @@ TEST_F(ContentAutofillDriverTest, PreviewFieldWithValue) {
EXPECT_EQ(input_value, output_value);
}
+TEST_F(ContentAutofillDriverTest, PreviewPassword) {
+ base::string16 input_value(base::ASCIIToUTF16("barqux"));
+ base::string16 output_value;
+ driver_->RendererShouldPreviewPassword(input_value);
+ EXPECT_TRUE(GetString16FromMessageWithID(
+ AutofillMsg_PreviewPassword::ID, &output_value));
+ EXPECT_EQ(input_value, output_value);
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698