| 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.content.Context; | 7 import android.content.Context; |
| 8 import android.os.Handler; | 8 import android.os.Handler; |
| 9 import android.view.View; | 9 import android.view.View; |
| 10 import android.view.ViewGroup; | 10 import android.view.ViewGroup; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 mWebContentsRef.set(mViewCoreRef.get().getWebContents()); | 141 mWebContentsRef.set(mViewCoreRef.get().getWebContents()); |
| 142 PaymentRequestUI.setObserverForTest(PaymentRequestTestBase.this)
; | 142 PaymentRequestUI.setObserverForTest(PaymentRequestTestBase.this)
; |
| 143 PaymentRequestImpl.setObserverForTest(PaymentRequestTestBase.thi
s); | 143 PaymentRequestImpl.setObserverForTest(PaymentRequestTestBase.thi
s); |
| 144 CardUnmaskPrompt.setObserverForTest(PaymentRequestTestBase.this)
; | 144 CardUnmaskPrompt.setObserverForTest(PaymentRequestTestBase.this)
; |
| 145 } | 145 } |
| 146 }); | 146 }); |
| 147 assertWaitForPageScaleFactorMatch(1); | 147 assertWaitForPageScaleFactorMatch(1); |
| 148 clickNodeAndWait(nodeId, helper); | 148 clickNodeAndWait(nodeId, helper); |
| 149 } | 149 } |
| 150 | 150 |
| 151 protected void reTriggerUIAndWait( |
| 152 String nodeId, PaymentsCallbackHelper<PaymentRequestUI> helper) |
| 153 throws InterruptedException, ExecutionException, TimeoutException { |
| 154 clickNodeAndWait(nodeId, helper); |
| 155 mUI = helper.getTarget(); |
| 156 } |
| 157 |
| 151 /** Clicks on an HTML node. */ | 158 /** Clicks on an HTML node. */ |
| 152 protected void clickNodeAndWait(String nodeId, CallbackHelper helper) | 159 protected void clickNodeAndWait(String nodeId, CallbackHelper helper) |
| 153 throws InterruptedException, ExecutionException, TimeoutException { | 160 throws InterruptedException, ExecutionException, TimeoutException { |
| 154 int callCount = helper.getCallCount(); | 161 int callCount = helper.getCallCount(); |
| 155 DOMUtils.clickNode(this, mViewCoreRef.get(), nodeId); | 162 DOMUtils.clickNode(this, mViewCoreRef.get(), nodeId); |
| 156 helper.waitForCallback(callCount); | 163 helper.waitForCallback(callCount); |
| 157 } | 164 } |
| 158 | 165 |
| 159 /** Clicks on an element in the payments UI. */ | 166 /** Clicks on an element in the payments UI. */ |
| 160 protected void clickAndWait(final int resourceId, CallbackHelper helper) | 167 protected void clickAndWait(final int resourceId, CallbackHelper helper) |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 List<PaymentItem> cart, JSONObject details, | 741 List<PaymentItem> cart, JSONObject details, |
| 735 InstrumentDetailsCallback detailsCallback) { | 742 InstrumentDetailsCallback detailsCallback) { |
| 736 detailsCallback.onInstrumentDetailsReady( | 743 detailsCallback.onInstrumentDetailsReady( |
| 737 mMethodName, "{\"transaction\": 1337}"); | 744 mMethodName, "{\"transaction\": 1337}"); |
| 738 } | 745 } |
| 739 | 746 |
| 740 @Override | 747 @Override |
| 741 public void dismissInstrument() {} | 748 public void dismissInstrument() {} |
| 742 } | 749 } |
| 743 } | 750 } |
| OLD | NEW |