Index: chrome/test/data/payments/can_make_payment_metrics.js |
diff --git a/chrome/test/data/payments/can_make_payment_metrics.js b/chrome/test/data/payments/can_make_payment_metrics.js |
index 62bb7f64f8554a62a371630b9bf3dbced101d3e8..2da0192035e1fa7e4ba379a8cb86def22ff75fb6 100644 |
--- a/chrome/test/data/payments/can_make_payment_metrics.js |
+++ b/chrome/test/data/payments/can_make_payment_metrics.js |
@@ -7,12 +7,14 @@ |
/* global PaymentRequest:false */ |
/* global print:false */ |
+var request; |
+ |
/** |
* Do not query CanMakePayment before showing the Payment Request. |
*/ |
function noQueryShow() { // eslint-disable-line no-unused-vars |
try { |
- var request = new PaymentRequest( |
+ request = new PaymentRequest( |
[{supportedMethods: ['https://bobpay.com', 'visa']}], |
{total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}}); |
request.show() |
@@ -34,7 +36,7 @@ function noQueryShow() { // eslint-disable-line no-unused-vars |
*/ |
function queryShow() { // eslint-disable-line no-unused-vars |
try { |
- var request = new PaymentRequest( |
+ request = new PaymentRequest( |
[{supportedMethods: ['https://bobpay.com', 'visa']}], |
{total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}}); |
request.canMakePayment() |
@@ -59,7 +61,7 @@ function queryShow() { // eslint-disable-line no-unused-vars |
*/ |
function queryNoShow() { // eslint-disable-line no-unused-vars |
try { |
- var request = new PaymentRequest( |
+ request = new PaymentRequest( |
[{supportedMethods: ['https://bobpay.com', 'visa']}], |
{total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}}); |
request.canMakePayment() |
@@ -69,3 +71,18 @@ function queryNoShow() { // eslint-disable-line no-unused-vars |
print(error.message); |
} |
} |
+ |
+/** |
+ * Aborts the PaymentRequest UI. |
+ */ |
+function abort() { // eslint-disable-line no-unused-vars |
+ try { |
+ request.abort().then(() => { |
+ print('Aborted'); |
+ }).catch(() => { |
+ print('Cannot abort'); |
+ }); |
+ } catch (error) { |
+ print(error.message); |
+ } |
+} |