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 /* Resets the mUI when doing a second payment request in the same test. */ | |
please use gerrit instead
2016/10/26 22:01:14
/** Clicks the HTML node to bring up the UI a seco
sebsg
2016/10/26 23:42:04
Done.
| |
152 protected void reTriggerUIAndWait( | |
153 String nodeId, PaymentsCallbackHelper<PaymentRequestUI> helper) | |
154 throws InterruptedException, ExecutionException, TimeoutException { | |
155 clickNodeAndWait(nodeId, (CallbackHelper) helper); | |
please use gerrit instead
2016/10/26 22:01:14
No need to cast PaymentsCallbackHelper to Callback
sebsg
2016/10/26 23:42:04
Done.
| |
156 mUI = helper.getTarget(); | |
157 } | |
158 | |
151 /** Clicks on an HTML node. */ | 159 /** Clicks on an HTML node. */ |
152 protected void clickNodeAndWait(String nodeId, CallbackHelper helper) | 160 protected void clickNodeAndWait(String nodeId, CallbackHelper helper) |
153 throws InterruptedException, ExecutionException, TimeoutException { | 161 throws InterruptedException, ExecutionException, TimeoutException { |
154 int callCount = helper.getCallCount(); | 162 int callCount = helper.getCallCount(); |
155 DOMUtils.clickNode(this, mViewCoreRef.get(), nodeId); | 163 DOMUtils.clickNode(this, mViewCoreRef.get(), nodeId); |
156 helper.waitForCallback(callCount); | 164 helper.waitForCallback(callCount); |
157 } | 165 } |
158 | 166 |
159 /** Clicks on an element in the payments UI. */ | 167 /** Clicks on an element in the payments UI. */ |
160 protected void clickAndWait(final int resourceId, CallbackHelper helper) | 168 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, | 742 List<PaymentItem> cart, JSONObject details, |
735 InstrumentDetailsCallback detailsCallback) { | 743 InstrumentDetailsCallback detailsCallback) { |
736 detailsCallback.onInstrumentDetailsReady( | 744 detailsCallback.onInstrumentDetailsReady( |
737 mMethodName, "{\"transaction\": 1337}"); | 745 mMethodName, "{\"transaction\": 1337}"); |
738 } | 746 } |
739 | 747 |
740 @Override | 748 @Override |
741 public void dismissInstrument() {} | 749 public void dismissInstrument() {} |
742 } | 750 } |
743 } | 751 } |
OLD | NEW |