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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPaymentAppAndCardsWithModifiersTest.java

Issue 2885443003: enable modifiers for native apps (Closed)
Patch Set: fixing compilation error and formatting 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.payments;
6
7 import android.support.test.filters.MediumTest;
8
9 import org.chromium.base.test.util.Feature;
10 import org.chromium.chrome.R;
11 import org.chromium.chrome.browser.autofill.AutofillTestHelper;
12 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
13 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard;
14
15 import java.util.concurrent.ExecutionException;
16 import java.util.concurrent.TimeoutException;
17
18 /**
19 * A payment integration test for a merchant that requests payment via Bob Pay o r cards, and
20 * modifiers at the same time.
gogerald1 2017/05/17 19:11:47 "A payment integration test for a merchant that re
wuandy1 2017/05/18 20:12:29 Done.
21 */
22 public class PaymentRequestPaymentAppAndCardsWithModifiersTest extends PaymentRe questTestBase {
23 public PaymentRequestPaymentAppAndCardsWithModifiersTest() {
gogerald1 2017/05/17 19:11:47 We are moving from using jUnit3 to jUnit4, you can
wuandy1 2017/05/18 20:12:29 Done.
24 super("payment_request_bobpay_and_cards_with_modifiers_test.html");
25 }
26
27 @Override
28 public void onMainActivityStarted()
29 throws InterruptedException, ExecutionException, TimeoutException {
30 AutofillTestHelper helper = new AutofillTestHelper();
31 String billingAddressId = helper.setProfile(new AutofillProfile("", "htt ps://example.com",
32 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", " ", "90291", "",
33 "US", "310-310-6000", "jon.doe@gmail.com", "en-US"));
34 // Mastercard card without a billing address.
35 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru e, "Jon Doe",
36 "5454545454545454", "", "12", "2050", "mastercard", R.drawable.p r_mc,
37 "" /* billingAddressId */, "" /* serverId */));
38 // Visa card with complete set of information.
39 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru e, "Jon Doe",
40 "4111111111111111", "", "12", "2050", "visa", R.drawable.pr_visa , billingAddressId,
41 "" /* serverId */));
42 }
43
44 /**
45 * If Bob Pay does not have any instruments, show [visa, mastercard]. Here t he payment app
gogerald1 2017/05/17 19:11:47 You used 'HAVE_INSTRUMENTS' below, but here says '
wuandy1 2017/05/18 20:12:29 fixed.
46 * responds quickly.
47 */
48 @MediumTest
49 @Feature({"Payments"})
50 public void testModifierUpdateTotalAndInstrumentLabel()
gogerald1 2017/05/17 19:11:47 suggest name: testUpdateTotalAndInstrumentLabelWit
wuandy1 2017/05/18 20:12:29 Done.
51 throws InterruptedException, ExecutionException, TimeoutException {
52 installPaymentApp(HAVE_INSTRUMENTS, IMMEDIATE_RESPONSE);
53 triggerUIAndWait(getReadyToPay());
54
55 assertTrue(getSelectedPaymentInstrumentLabel().startsWith("https://bobpa y.com"));
56 assertEquals("USD $4.00", getOrderSummaryTotal());
57
58 clickOnPaymentMethodSuggestionOptionAndWait(1, getReadyForInput());
gogerald1 2017/05/17 19:11:47 Comments on what you are doing here
wuandy1 2017/05/18 20:12:29 Done.
wuandy1 2017/05/18 20:12:29 Done.
59 assertTrue(getSelectedPaymentInstrumentLabel().startsWith("Visa"));
60 assertEquals("USD $5.00", getOrderSummaryTotal());
61 }
62
63 @MediumTest
64 @Feature({"Payments"})
65 public void testPaymentAppAbleToPayAfterApplyingModifiers()
gogerald1 2017/05/17 19:11:47 suggest name: testPaymentAppCanPayWithModifiers
gogerald1 2017/05/17 19:11:47 Add comments to explain this test
wuandy1 2017/05/18 20:12:29 Done.
wuandy1 2017/05/18 20:12:29 Done.
66 throws InterruptedException, ExecutionException, TimeoutException {
67 installPaymentApp(HAVE_INSTRUMENTS, DELAYED_RESPONSE);
68 triggerUIAndWait(getReadyToPay());
69
70 assertTrue(getSelectedPaymentInstrumentLabel().startsWith("https://bobpa y.com"));
71 assertEquals("USD $4.00", getOrderSummaryTotal());
72
73 clickAndWait(R.id.button_primary, getDismissed());
74
75 expectResultContains(new String[] {"https://bobpay.com", "\"transaction\ "", "1337"});
gogerald1 2017/05/17 19:11:47 Can you check whether the received modifiers are c
wuandy1 2017/05/18 20:12:29 Current test-supporting code does not provide a wa
gogerald1 2017/05/18 21:57:33 Acknowledged.
76 }
77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698