Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 package org.chromium.chrome.browser.payments; | 5 package org.chromium.chrome.browser.payments; |
| 6 | 6 |
| 7 import android.support.test.filters.MediumTest; | 7 import android.support.test.filters.MediumTest; |
| 8 | 8 |
| 9 import org.junit.Rule; | 9 import org.junit.Rule; |
| 10 import org.junit.Test; | 10 import org.junit.Test; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 new PaymentAppFactory.PaymentAppFactoryAddition() { | 58 new PaymentAppFactory.PaymentAppFactoryAddition() { |
| 59 @Override | 59 @Override |
| 60 public void create(WebContents webContents, Set<String> meth odNames, | 60 public void create(WebContents webContents, Set<String> meth odNames, |
| 61 PaymentAppFactory.PaymentAppCreatedCallback callback ) { | 61 PaymentAppFactory.PaymentAppCreatedCallback callback ) { |
| 62 List<PaymentInstrument> instruments = new ArrayList<Paym entInstrument>(); | 62 List<PaymentInstrument> instruments = new ArrayList<Paym entInstrument>(); |
| 63 | 63 |
| 64 if (instrumentPresence != NO_OPTIONS) { | 64 if (instrumentPresence != NO_OPTIONS) { |
| 65 instruments.add(new ServiceWorkerPaymentInstrument(w ebContents, | 65 instruments.add(new ServiceWorkerPaymentInstrument(w ebContents, |
| 66 0 /* swRegistrationId */, "new" /* instrumen tId */, | 66 0 /* swRegistrationId */, "new" /* instrumen tId */, |
| 67 "Create BobPay account" /* label */, | 67 "Create BobPay account" /* label */, |
| 68 new HashSet<String>(Arrays.asList("https://b obpay.com", | 68 new HashSet<String>(Arrays.asList( |
| 69 "basic-card")) /* methodNames */)); | 69 "https://bobpay.com", "basic-card")) /* methodNames */, |
|
dcheng
2017/06/10 00:37:10
Nit: this should probably using something like exa
gogerald1
2017/06/12 16:19:43
This is not a complete random domain, it is a fake
dcheng
2017/06/13 09:02:55
Can we change it to point to the test domain we co
gogerald1
2017/06/13 15:37:19
Not completely understand what's the difference of
dcheng
2017/06/13 17:33:15
bobpay.com => points to a parked domain
bobpay.xyz
gogerald1
2017/06/14 01:28:16
Acknowledged. will bring it up in our team to disc
| |
| 70 null /* icon*/)); | |
| 70 } | 71 } |
| 71 | 72 |
| 72 if (instrumentPresence == TWO_OPTIONS) { | 73 if (instrumentPresence == TWO_OPTIONS) { |
| 73 instruments.add(new ServiceWorkerPaymentInstrument(w ebContents, | 74 instruments.add(new ServiceWorkerPaymentInstrument(w ebContents, |
| 74 0 /* swRegistrationId */, "existing" /* inst rumentId */, | 75 0 /* swRegistrationId */, "existing" /* inst rumentId */, |
| 75 "Existing BobPay account" /* label */, | 76 "Existing BobPay account" /* label */, |
| 76 new HashSet<String>(Arrays.asList("https://b obpay.com", | 77 new HashSet<String>(Arrays.asList( |
| 77 "basic-card")) /* methodNames */)); | 78 "https://bobpay.com", "basic-card")) /* methodNames */, |
| 79 null /* icon */)); | |
| 78 } | 80 } |
| 79 | 81 |
| 80 callback.onPaymentAppCreated( | 82 callback.onPaymentAppCreated( |
| 81 new ServiceWorkerPaymentApp(webContents, instrum ents)); | 83 new ServiceWorkerPaymentApp(webContents, instrum ents)); |
| 82 callback.onAllPaymentAppsCreated(); | 84 callback.onAllPaymentAppsCreated(); |
| 83 } | 85 } |
| 84 }); | 86 }); |
| 85 } | 87 } |
| 86 | 88 |
| 87 @Test | 89 @Test |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 107 @Test | 109 @Test |
| 108 @MediumTest | 110 @MediumTest |
| 109 @Feature({"Payments"}) | 111 @Feature({"Payments"}) |
| 110 public void testTwoOptions() throws InterruptedException, ExecutionException , TimeoutException { | 112 public void testTwoOptions() throws InterruptedException, ExecutionException , TimeoutException { |
| 111 installMockServiceWorkerPaymentApp(TWO_OPTIONS); | 113 installMockServiceWorkerPaymentApp(TWO_OPTIONS); |
| 112 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead yForInput()); | 114 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead yForInput()); |
| 113 // TODO(tommyt): crbug.com/669876. Expand this test as we implement more | 115 // TODO(tommyt): crbug.com/669876. Expand this test as we implement more |
| 114 // service worker based payment app functionality. | 116 // service worker based payment app functionality. |
| 115 } | 117 } |
| 116 } | 118 } |
| OLD | NEW |