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

Side by Side Diff: chrome/browser/ui/views/payments/payment_request_browsertest.cc

Issue 2779283002: [Web Payments] Implement the CVC Unmask dialog. (Closed)
Patch Set: BUILD Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 <vector> 5 #include <vector>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/browser_commands.h" 9 #include "chrome/browser/ui/browser_commands.h"
10 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" 10 #include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 autofill::AutofillProfile billing_address = autofill::test::GetFullProfile(); 85 autofill::AutofillProfile billing_address = autofill::test::GetFullProfile();
86 AddAutofillProfile(billing_address); 86 AddAutofillProfile(billing_address);
87 autofill::CreditCard card = autofill::test::GetCreditCard(); 87 autofill::CreditCard card = autofill::test::GetCreditCard();
88 card.set_billing_address_id(billing_address.guid()); 88 card.set_billing_address_id(billing_address.guid());
89 AddCreditCard(card); // Visa. 89 AddCreditCard(card); // Visa.
90 90
91 InvokePaymentRequestUI(); 91 InvokePaymentRequestUI();
92 92
93 ResetEventObserver(DialogEvent::DIALOG_CLOSED); 93 ResetEventObserver(DialogEvent::DIALOG_CLOSED);
94 94
95 ClickOnDialogViewAndWait(DialogViewID::PAY_BUTTON); 95 PayWithCreditCardAndWait(base::ASCIIToUTF16("123"));
96 96
97 WaitForObservedEvent(); 97 WaitForObservedEvent();
98 98
99 // The actual structure of the card response is unit-tested. 99 // The actual structure of the card response is unit-tested.
100 ExpectBodyContains(std::vector<base::string16>{ 100 ExpectBodyContains(std::vector<base::string16>{
101 card.GetRawInfo(autofill::CREDIT_CARD_NUMBER), 101 card.GetRawInfo(autofill::CREDIT_CARD_NUMBER),
102 card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL), 102 card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL),
103 card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH), 103 card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH),
104 card.GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR)}); 104 card.GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR)});
105 ExpectBodyContains(std::vector<base::string16>{ 105 ExpectBodyContains(std::vector<base::string16>{
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 EXPECT_EQ(1u, requests.size()); 274 EXPECT_EQ(1u, requests.size());
275 std::vector<std::string> supported_card_networks = 275 std::vector<std::string> supported_card_networks =
276 requests[0]->spec()->supported_card_networks(); 276 requests[0]->spec()->supported_card_networks();
277 EXPECT_EQ(3u, supported_card_networks.size()); 277 EXPECT_EQ(3u, supported_card_networks.size());
278 EXPECT_EQ("mastercard", supported_card_networks[0]); 278 EXPECT_EQ("mastercard", supported_card_networks[0]);
279 EXPECT_EQ("visa", supported_card_networks[1]); 279 EXPECT_EQ("visa", supported_card_networks[1]);
280 EXPECT_EQ("jcb", supported_card_networks[2]); 280 EXPECT_EQ("jcb", supported_card_networks[2]);
281 } 281 }
282 282
283 } // namespace payments 283 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698