Commit 8e4b94a5 authored by estade's avatar estade Committed by Commit bot

Add test for requestAutocomplete and readonly attribute.

BUG=231160

Review URL: https://codereview.chromium.org/650293002

Cr-Commit-Position: refs/heads/master@{#299411}
parent b7c53d5f
...@@ -1772,4 +1772,19 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, ...@@ -1772,4 +1772,19 @@ IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest,
EXPECT_EQ(ASCIIToUTF16("USD"), controller->transaction_currency_); EXPECT_EQ(ASCIIToUTF16("USD"), controller->transaction_currency_);
} }
// Same as above, plus readonly attribute.
IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest,
TransactionAmountReadonly) {
std::string html(
"<input type='number' step='0.01'"
" autocomplete='transaction-amount' value='24' readonly>"
"<input autocomplete='transaction-currency' value='USD' readonly>"
"<input autocomplete='cc-csc'>");
AutofillDialogControllerImpl* controller = SetUpHtmlAndInvoke(html);
ASSERT_TRUE(controller);
EXPECT_EQ(ASCIIToUTF16("24"), controller->transaction_amount_);
EXPECT_EQ(ASCIIToUTF16("USD"), controller->transaction_currency_);
}
} // namespace autofill } // namespace autofill
...@@ -332,6 +332,8 @@ class AutofillDialogControllerImpl ...@@ -332,6 +332,8 @@ class AutofillDialogControllerImpl
CorrectCountryFromInputs); CorrectCountryFromInputs);
FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest, FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest,
TransactionAmount); TransactionAmount);
FRIEND_TEST_ALL_PREFIXES(AutofillDialogControllerTest,
TransactionAmountReadonly);
// Initializes or updates |suggested_cc_| et al. // Initializes or updates |suggested_cc_| et al.
void SuggestionsUpdated(); void SuggestionsUpdated();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment