OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 " autocomplete='transaction-amount' value='24'>" | 1765 " autocomplete='transaction-amount' value='24'>" |
1766 "<input autocomplete='transaction-currency' value='USD'>" | 1766 "<input autocomplete='transaction-currency' value='USD'>" |
1767 "<input autocomplete='cc-csc'>"); | 1767 "<input autocomplete='cc-csc'>"); |
1768 AutofillDialogControllerImpl* controller = SetUpHtmlAndInvoke(html); | 1768 AutofillDialogControllerImpl* controller = SetUpHtmlAndInvoke(html); |
1769 ASSERT_TRUE(controller); | 1769 ASSERT_TRUE(controller); |
1770 | 1770 |
1771 EXPECT_EQ(ASCIIToUTF16("24"), controller->transaction_amount_); | 1771 EXPECT_EQ(ASCIIToUTF16("24"), controller->transaction_amount_); |
1772 EXPECT_EQ(ASCIIToUTF16("USD"), controller->transaction_currency_); | 1772 EXPECT_EQ(ASCIIToUTF16("USD"), controller->transaction_currency_); |
1773 } | 1773 } |
1774 | 1774 |
| 1775 // Same as above, plus readonly attribute. |
| 1776 IN_PROC_BROWSER_TEST_F(AutofillDialogControllerTest, |
| 1777 TransactionAmountReadonly) { |
| 1778 std::string html( |
| 1779 "<input type='number' step='0.01'" |
| 1780 " autocomplete='transaction-amount' value='24' readonly>" |
| 1781 "<input autocomplete='transaction-currency' value='USD' readonly>" |
| 1782 "<input autocomplete='cc-csc'>"); |
| 1783 AutofillDialogControllerImpl* controller = SetUpHtmlAndInvoke(html); |
| 1784 ASSERT_TRUE(controller); |
| 1785 |
| 1786 EXPECT_EQ(ASCIIToUTF16("24"), controller->transaction_amount_); |
| 1787 EXPECT_EQ(ASCIIToUTF16("USD"), controller->transaction_currency_); |
| 1788 } |
| 1789 |
1775 } // namespace autofill | 1790 } // namespace autofill |
OLD | NEW |