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

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

Issue 2455513004: [Payments] Fix the Payment Request histogram check failure in tests. (Closed)
Patch Set: Created 4 years, 1 month 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
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698