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

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

Issue 14613002: Tests for invalid suggestions (i.e. expired cards) in the Autofill dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc ('k') | no next file » | 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/guid.h" 5 #include "base/guid.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" 10 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 const FormStructure* form_structure_; 410 const FormStructure* form_structure_;
411 411
412 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerTest); 412 DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerTest);
413 }; 413 };
414 414
415 } // namespace 415 } // namespace
416 416
417 // This test makes sure nothing falls over when fields are being validity- 417 // This test makes sure nothing falls over when fields are being validity-
418 // checked. 418 // checked.
419 TEST_F(AutofillDialogControllerTest, ValidityCheck) { 419 TEST_F(AutofillDialogControllerTest, ValidityCheck) {
420 const DialogSection sections[] = { 420 for (size_t i = SECTION_MIN; i <= SECTION_MAX; ++i) {
421 SECTION_EMAIL, 421 DialogSection section = static_cast<DialogSection>(i);
422 SECTION_CC,
423 SECTION_BILLING,
424 SECTION_CC_BILLING,
425 SECTION_SHIPPING
426 };
427
428 for (size_t i = 0; i < arraysize(sections); ++i) {
429 DialogSection section = sections[i];
430 const DetailInputs& shipping_inputs = 422 const DetailInputs& shipping_inputs =
431 controller()->RequestedFieldsForSection(section); 423 controller()->RequestedFieldsForSection(section);
432 for (DetailInputs::const_iterator iter = shipping_inputs.begin(); 424 for (DetailInputs::const_iterator iter = shipping_inputs.begin();
433 iter != shipping_inputs.end(); ++iter) { 425 iter != shipping_inputs.end(); ++iter) {
434 controller()->InputValidityMessage(iter->type, string16()); 426 controller()->InputValidityMessage(iter->type, string16());
435 } 427 }
436 } 428 }
437 } 429 }
438 430
439 // Test for phone number validation. 431 // Test for phone number validation.
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 controller()->OnDidGetWalletItems( 1808 controller()->OnDidGetWalletItems(
1817 wallet::WalletItems::CreateWalletItems(dict).Pass()); 1809 wallet::WalletItems::CreateWalletItems(dict).Pass());
1818 1810
1819 EXPECT_FALSE(controller()->MenuModelForSection(SECTION_CC_BILLING)); 1811 EXPECT_FALSE(controller()->MenuModelForSection(SECTION_CC_BILLING));
1820 // "Same as billing" and "Add address...". 1812 // "Same as billing" and "Add address...".
1821 EXPECT_EQ( 1813 EXPECT_EQ(
1822 2, controller()->MenuModelForSection(SECTION_SHIPPING)->GetItemCount()); 1814 2, controller()->MenuModelForSection(SECTION_SHIPPING)->GetItemCount());
1823 } 1815 }
1824 1816
1825 } // namespace autofill 1817 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698