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

Unified Diff: chrome/test/data/android/payments/metrics.js

Issue 2396643002: [Payments] Add Payment Request journey metrics. (Closed)
Patch Set: Nit Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/android/payments/metrics.js
diff --git a/chrome/test/data/android/payments/metrics.js b/chrome/test/data/android/payments/metrics.js
index fe9dd0ab0b726b490af10b410d111ee1489f0c89..54a7c2db6edf97814a36c8b533c35ca5c99fdb25 100644
--- a/chrome/test/data/android/payments/metrics.js
+++ b/chrome/test/data/android/payments/metrics.js
@@ -14,6 +14,15 @@ var request;
*/
function ccBuy() { // eslint-disable-line no-unused-vars
try {
+ var details = {
+ total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
+ shippingOptions: [{
+ id: 'freeShippingOption',
+ label: 'Free global shipping',
+ amount: {currency: 'USD', value: '0'},
+ selected: true
+ }]
+ };
request = new PaymentRequest(
[{supportedMethods: ['visa']}], {
total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
@@ -38,6 +47,12 @@ function ccBuy() { // eslint-disable-line no-unused-vars
}).catch(function(error) {
print(error);
});
+ request.addEventListener('shippingaddresschange', function(e) {
+ e.updateWith(new Promise(function(resolve) {
+ // No changes in price based on shipping address change.
+ resolve(details);
+ }));
+ })
} catch (error) {
print(error.message);
}

Powered by Google App Engine
This is Rietveld 408576698