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

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

Issue 1941623002: Android integration tests for PaymentRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@address-in-result
Patch Set: Address comments Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..e698ca0f53ca97040c712ef8142ac70a01cbf3a3
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestFreeShippingTest.java
@@ -0,0 +1,46 @@
+// 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.chrome.browser.autofill.AutofillTestHelper;
+import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
+import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+
+/**
+ * A payment integration test with a single card and a single shipping address.
+ */
+public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase {
+ public PaymentRequestFreeShippingTest() {
+ super("payment_request_free_shipping_test.html");
+ }
+
+ @Override
+ public void onMainActivityStarted()
+ throws InterruptedException, ExecutionException, TimeoutException {
+ AutofillTestHelper helper = new AutofillTestHelper();
+ helper.setProfile(new AutofillProfile("", "https://www.example.com", true, "Jon Doe",
+ "Acme", "123 Main St", "CA", "Los Angeles", "", "12345", "", "US", "", "",
+ "en-US"));
+ helper.setCreditCard(new CreditCard("", "https://www.example.com", true, true, "Jon Smith",
+ "4111111111111111", "Visa ***1111", "12", "2050", "visa", 0));
+ }
+
+ @MediumTest
+ public void testPay() throws InterruptedException, ExecutionException, TimeoutException {
+ triggerPaymentUI();
+ clickPrimaryPaymentUIButton();
+ typeInCvc("123");
+ clickPrimaryCVCPromptButton();
+ waitForPaymentUIHidden();
+ expectResultContains(new String[] {"visa", "4111111111111111", "12", "2050", "123",
+ "Jon Smith", "123 Main St", "Acme", "CA", "Los Angeles", "12345", "US", "en",
+ "freeShippingOption"});
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698