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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFieldTrialTest.java

Issue 2437593007: [Payments] Field trial and flag to abort payment request if no card. (Closed)
Patch Set: Disabled experiment for tests Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFieldTrialTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFieldTrialTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFieldTrialTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..72104f2179f4dc09e30a2bbdf6a972c7b05250d1
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFieldTrialTest.java
@@ -0,0 +1,74 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.payments;
+
+import android.test.suitebuilder.annotation.MediumTest;
+
+import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.Feature;
+import org.chromium.chrome.browser.autofill.AutofillTestHelper;
+import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
+/**
+ * A payment integration test for the different fields trials affecting payment requests.
+ */
+public class PaymentRequestFieldTrialTest extends PaymentRequestTestBase {
+ public PaymentRequestFieldTrialTest() {
+ // This merchant supports bobpay and credit cards payments.
+ super("payment_request_bobpay_and_cards_test.html");
+ }
+
+ @Override
+ public void onMainActivityStarted()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ AutofillTestHelper helper = new AutofillTestHelper();
+ // The user has a shipping address on disk but no credit card.
+ helper.setProfile(new AutofillProfile("", "https://example.com", true, "Jon Doe", "Google",
+ "340 Main St", "CA", "Los Angeles", "", "90291", "", "US", "555-555-5555", "",
+ "en-US"));
+ }
+
+ /**
+ * Tests that the Payment Request is cancelled if the user has no credit card and the proper
+ * command line flag is set.
+ */
+ @MediumTest
+ @Feature({"Payments"})
+ @CommandLineFlags.Add("enable-features=NoCreditCardAbort")
+ public void testAbortIfNoCard_Enabled_NoApp()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ triggerUIAndWait(mShowFailed);
+ expectResultContains(new String[] {"The payment method is not supported"});
+ }
+
+ /**
+ * Tests that the Payment Request UI is shown even if the user has no credit card and the proper
+ * command line flag is set, if they have another payment app that is accepted by the merchant.
+ */
+ @MediumTest
+ @Feature({"Payments"})
+ @CommandLineFlags.Add("enable-features=NoCreditCardAbort")
+ public void testAbortIfNoCard_Enabled_WithApp()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ installPaymentApp(HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE);
+ triggerUIAndWait(mReadyToPay);
+ }
+
+ /**
+ * Tests that the Payment Request UI is shown if the user has no credit card and the proper
+ * command line flag is set.
+ */
+ @MediumTest
+ @Feature({"Payments"})
+ @CommandLineFlags.Add("disable-features=NoCreditCardAbort")
+ public void testAbortIfNoCard_Disabled()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ // Check that the Payment Request UI is shown.
+ triggerUIAndWait(mReadyForInput);
+ }
+}
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698