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

Side by Side Diff: chrome/test/data/android/payments/metrics.js

Issue 2220713002: [Payments] Add Payment Request metrics for selected payment method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The Chromium Authors. All rights reserved. 2 * Copyright 2016 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* global PaymentRequest:false */ 7 /* global PaymentRequest:false */
8 /* global toDictionary:false */ 8 /* global toDictionary:false */
9 9
10 var request; 10 var request;
11 11
12 /** 12 /**
13 * Launches the PaymentRequest UI that accepts credit cards. 13 * Launches the PaymentRequest UI that accepts credit cards.
14 */ 14 */
15 function buy() { // eslint-disable-line no-unused-vars 15 function ccBuy() { // eslint-disable-line no-unused-vars
16 try { 16 try {
17 request = new PaymentRequest( 17 request = new PaymentRequest(
18 [{supportedMethods: ['visa']}], { 18 [{supportedMethods: ['visa']}], {
19 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}, 19 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
20 shippingOptions: [{ 20 shippingOptions: [{
21 id: 'freeShippingOption', 21 id: 'freeShippingOption',
22 label: 'Free global shipping', 22 label: 'Free global shipping',
23 amount: {currency: 'USD', value: '0'}, 23 amount: {currency: 'USD', value: '0'},
24 selected: true 24 selected: true
25 }] 25 }]
(...skipping 14 matching lines...) Expand all
40 }); 40 });
41 } catch (error) { 41 } catch (error) {
42 print(error.message); 42 print(error.message);
43 } 43 }
44 } 44 }
45 45
46 /** 46 /**
47 * Launches the PaymentRequest UI which accepts a supported payment method but 47 * Launches the PaymentRequest UI which accepts a supported payment method but
48 * does not accept credit cards. 48 * does not accept credit cards.
49 */ 49 */
50 function noMatching() { // eslint-disable-line no-unused-vars 50 function bobPayBuy() { // eslint-disable-line no-unused-vars
51 try { 51 try {
52 request = new PaymentRequest( 52 request = new PaymentRequest(
53 [{supportedMethods: ['https://bobpay.com']}], { 53 [{supportedMethods: ['https://bobpay.com']}], {
54 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}, 54 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
55 shippingOptions: [{ 55 shippingOptions: [{
56 id: 'freeShippingOption', 56 id: 'freeShippingOption',
57 label: 'Free global shipping', 57 label: 'Free global shipping',
58 amount: {currency: 'USD', value: '0'}, 58 amount: {currency: 'USD', value: '0'},
59 selected: true 59 selected: true
60 }] 60 }]
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 try { 120 try {
121 request.abort().then(function() { 121 request.abort().then(function() {
122 print('Aborted'); 122 print('Aborted');
123 }).catch(function() { 123 }).catch(function() {
124 print('Cannot abort'); 124 print('Cannot abort');
125 }); 125 });
126 } catch (error) { 126 } catch (error) {
127 print(error.message); 127 print(error.message);
128 } 128 }
129 } 129 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698