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

Side by Side Diff: components/autofill/core/browser/autofill_external_delegate_unittest.cc

Issue 2849523003: Add billing address as a mandatory field of Payments credit cards. (Closed)
Patch Set: Components Unittests fix Created 3 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <memory> 5 #include <memory>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 } 683 }
684 684
685 MATCHER_P(CreditCardMatches, card, "") { 685 MATCHER_P(CreditCardMatches, card, "") {
686 return !arg.Compare(card); 686 return !arg.Compare(card);
687 } 687 }
688 688
689 // Test that autofill manager will fill the credit card form after user scans a 689 // Test that autofill manager will fill the credit card form after user scans a
690 // credit card. 690 // credit card.
691 TEST_F(AutofillExternalDelegateUnitTest, FillCreditCardForm) { 691 TEST_F(AutofillExternalDelegateUnitTest, FillCreditCardForm) {
692 CreditCard card; 692 CreditCard card;
693 test::SetCreditCardInfo(&card, "Alice", "4111", "1", "3000"); 693 test::SetCreditCardInfo(&card, "Alice", "4111", "1", "3000", "1");
694 EXPECT_CALL(*autofill_manager_, 694 EXPECT_CALL(*autofill_manager_,
695 FillCreditCardForm(_, _, _, CreditCardMatches(card), base::string16())); 695 FillCreditCardForm(_, _, _, CreditCardMatches(card), base::string16()));
696 external_delegate_->OnCreditCardScanned(card); 696 external_delegate_->OnCreditCardScanned(card);
697 } 697 }
698 698
699 TEST_F(AutofillExternalDelegateUnitTest, IgnoreAutocompleteOffForAutofill) { 699 TEST_F(AutofillExternalDelegateUnitTest, IgnoreAutocompleteOffForAutofill) {
700 const FormData form; 700 const FormData form;
701 FormFieldData field; 701 FormFieldData field;
702 field.is_focusable = true; 702 field.is_focusable = true;
703 field.should_autocomplete = false; 703 field.should_autocomplete = false;
(...skipping 18 matching lines...) Expand all
722 RendererShouldFillFieldWithValue(dummy_string)); 722 RendererShouldFillFieldWithValue(dummy_string));
723 base::HistogramTester histogram_tester; 723 base::HistogramTester histogram_tester;
724 external_delegate_->DidAcceptSuggestion(dummy_string, 724 external_delegate_->DidAcceptSuggestion(dummy_string,
725 POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY, 725 POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY,
726 0); 726 0);
727 histogram_tester.ExpectUniqueSample( 727 histogram_tester.ExpectUniqueSample(
728 "Autofill.SuggestionAcceptedIndex.Autocomplete", 0, 1); 728 "Autofill.SuggestionAcceptedIndex.Autocomplete", 0, 1);
729 } 729 }
730 730
731 } // namespace autofill 731 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698