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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc

Issue 650293002: Add test for requestAutocomplete and readonly attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_controller_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698