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

Unified Diff: chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc

Issue 2775193004: [Payments] Have an observer for canMakePayment, for testing. (Closed)
Patch Set: addressed comments Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc
index 707ddf804bb19cb9313bc5498f29f9ca4500c095..bc9b96d5a7a9e47303ca660e3d5bc798b3f0a999 100644
--- a/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc
+++ b/chrome/browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc
@@ -21,7 +21,9 @@ class PaymentRequestCanMakePaymentQueryTest
"/payment_request_can_make_payment_query_test.html") {}
void CallCanMakePayment() {
+ ResetEventObserver(DialogEvent::CAN_MAKE_PAYMENT_CALLED);
ASSERT_TRUE(content::ExecuteScript(GetActiveWebContents(), "buy();"));
+ WaitForObservedEvent();
}
private:
@@ -29,9 +31,8 @@ class PaymentRequestCanMakePaymentQueryTest
};
// Visa is required, and user has a visa instrument.
-// Test is flaky. crbug.com/705225
IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentQueryTest,
- DISABLED_CanMakePayment_Supported) {
+ CanMakePayment_Supported) {
const autofill::CreditCard card = autofill::test::GetCreditCard(); // Visa.
AddCreditCard(card);
@@ -40,10 +41,10 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentQueryTest,
ExpectBodyContains(std::vector<base::string16>{base::ASCIIToUTF16("true")});
}
-// Visa is required, and user has a visa instrument, and user is in incognito
+// Visa is required, user has a visa instrument, and user is in incognito
// mode.
IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentQueryTest,
- CanMakePayment_Supported_Incognito) {
+ CanMakePayment_Supported_InIncognitoMode) {
SetIncognitoForTesting();
const autofill::CreditCard card = autofill::test::GetCreditCard(); // Visa.
@@ -65,11 +66,10 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentQueryTest,
ExpectBodyContains(std::vector<base::string16>{base::ASCIIToUTF16("false")});
}
-// Visa is required, and user doesn't have a visa instrument and the user is in
-// incognito mode.
-// Test is flaky. crbug.com/705271
+// Visa is required, user doesn't have a visa instrument and the user is in
+// incognito mode. In this case canMakePayment always returns true.
IN_PROC_BROWSER_TEST_F(PaymentRequestCanMakePaymentQueryTest,
- DISABLED_CanMakePayment_NotSupported_Incognito) {
+ CanMakePayment_NotSupported_InIncognitoMode) {
SetIncognitoForTesting();
const autofill::CreditCard card = autofill::test::GetCreditCard2(); // Amex.
« no previous file with comments | « chrome/browser/ui/views/payments/payment_request_browsertest_base.cc ('k') | components/payments/content/payment_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698