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

Unified Diff: chrome/test/data/payments/can_make_payment_metrics.js

Issue 2851893002: [Payments] Record CanMakePayment metrics on Desktop. (Closed)
Patch Set: Windows Fix and Rebase Fix Created 3 years, 7 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | chrome/test/data/payments/payment_request_can_make_payment_metrics_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
+}
« no previous file with comments | « chrome/test/BUILD.gn ('k') | chrome/test/data/payments/payment_request_can_make_payment_metrics_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698