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

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

Issue 2810323002: [Payments] Add metric for when Pr UI is skipped. (Closed)
Patch Set: Addressed comments Created 3 years, 8 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 8
9 var request; 9 var request;
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 print(JSON.stringify(resp, undefined, 2)); 75 print(JSON.stringify(resp, undefined, 2));
76 }).catch(function(error) { 76 }).catch(function(error) {
77 print(error); 77 print(error);
78 }); 78 });
79 } catch (error) { 79 } catch (error) {
80 print(error.message); 80 print(error.message);
81 } 81 }
82 } 82 }
83 83
84 /** 84 /**
85 * Launches the PaymentRequest UI which accepts only Android Pay and does not
86 * require any other information.
87 */
88 function androidPaySkipUiBuy() { // eslint-disable-line no-unused-vars
89 try {
90 request = new PaymentRequest(
91 [{supportedMethods: ['https://android.com/pay']}], {
92 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
93 });
94 request.show()
95 .then(function(resp) {
96 return resp.complete('success');
97 }).then(function() {
98 print(JSON.stringify(resp, undefined, 2));
99 }).catch(function(error) {
100 print(error);
101 });
102 } catch (error) {
103 print(error.message);
104 }
105 }
106
107 /**
85 * Launches the PaymentRequest UI which accepts only an unsupported payment 108 * Launches the PaymentRequest UI which accepts only an unsupported payment
86 * method. 109 * method.
87 */ 110 */
88 function noSupported() { // eslint-disable-line no-unused-vars 111 function noSupported() { // eslint-disable-line no-unused-vars
89 try { 112 try {
90 request = new PaymentRequest( 113 request = new PaymentRequest(
91 [{supportedMethods: ['https://randompay.com']}], { 114 [{supportedMethods: ['https://randompay.com']}], {
92 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}, 115 total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
93 shippingOptions: [{ 116 shippingOptions: [{
94 id: 'freeShippingOption', 117 id: 'freeShippingOption',
(...skipping 23 matching lines...) Expand all
118 try { 141 try {
119 request.abort().then(function() { 142 request.abort().then(function() {
120 print('Aborted'); 143 print('Aborted');
121 }).catch(function() { 144 }).catch(function() {
122 print('Cannot abort'); 145 print('Cannot abort');
123 }); 146 });
124 } catch (error) { 147 } catch (error) {
125 print(error.message); 148 print(error.message);
126 } 149 }
127 } 150 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698