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

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: Update code as per Ilya's comment. 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 c116cfcc1ddc158db62ff1894770e5fe78612bb6..46f15d7da725500aad4495c1076dd502b02a6b3b 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 content::RenderViewHostTestHarness {
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))
@@ -298,7 +302,7 @@ TEST_F(ContentAutofillDriverTest, AcceptDataListSuggestion) {
TEST_F(ContentAutofillDriverTest, AcceptPasswordAutofillSuggestion) {
base::string16 input_value(base::ASCIIToUTF16("barbaz"));
base::string16 output_value;
- driver_->RendererShouldAcceptPasswordAutofillSuggestion(input_value);
+ driver_->RendererShouldFillPassword(input_value);
EXPECT_TRUE(GetString16FromMessageWithID(
AutofillMsg_AcceptPasswordAutofillSuggestion::ID, &output_value));
EXPECT_EQ(input_value, output_value);
@@ -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