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

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

Issue 2623653003: [Payments] Move Payment Request test files to chrome/test/data/payments (Closed)
Patch Set: Created 3 years, 11 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/data/android/payments/free_shipping.js ('k') | chrome/test/data/android/payments/name.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
deleted file mode 100644
index 54a7c2db6edf97814a36c8b533c35ca5c99fdb25..0000000000000000000000000000000000000000
--- a/chrome/test/data/android/payments/metrics.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright 2016 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* global PaymentRequest:false */
-/* global toDictionary:false */
-
-var request;
-
-/**
- * Launches the PaymentRequest UI that accepts credit cards.
- */
-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'}},
- shippingOptions: [{
- id: 'freeShippingOption',
- label: 'Free global shipping',
- amount: {currency: 'USD', value: '0'},
- selected: true
- }]
- },
- {requestShipping: true});
- request.show()
- .then(function(resp) {
- return resp.complete('success')
- }).then(function() {
- print(
- resp.shippingOption + '<br>' +
- JSON.stringify(
- toDictionary(resp.shippingAddress), undefined, 2) +
- '<br>' + resp.methodName + '<br>' +
- JSON.stringify(resp.details, undefined, 2));
- }).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);
- }
-}
-
-/**
- * Launches the PaymentRequest UI which accepts only Android Pay.
- */
-function androidPayBuy() { // eslint-disable-line no-unused-vars
- try {
- request = new PaymentRequest(
- [{supportedMethods: ['https://android.com/pay']}], {
- total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
- shippingOptions: [{
- id: 'freeShippingOption',
- label: 'Free global shipping',
- amount: {currency: 'USD', value: '0'},
- selected: true
- }]
- },
- {requestShipping: true});
- request.show()
- .then(function(resp) {
- return resp.complete('success');
- }).then(function() {
- print(
- resp.shippingOption + '<br>' +
- JSON.stringify(
- toDictionary(resp.shippingAddress), undefined, 2) +
- '<br>' + resp.methodName + '<br>' +
- JSON.stringify(resp.details, undefined, 2));
- }).catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error.message);
- }
-}
-
-/**
- * Launches the PaymentRequest UI which accepts only an unsupported payment
- * method.
- */
-function noSupported() { // eslint-disable-line no-unused-vars
- try {
- request = new PaymentRequest(
- [{supportedMethods: ['https://randompay.com']}], {
- total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
- shippingOptions: [{
- id: 'freeShippingOption',
- label: 'Free global shipping',
- amount: {currency: 'USD', value: '0'},
- selected: true
- }]
- },
- {requestShipping: true});
- request.show()
- .then(function(resp) {
- return resp.complete('success');
- }).then(function() {
- print(
- resp.shippingOption + '<br>' +
- JSON.stringify(
- toDictionary(resp.shippingAddress), undefined, 2) +
- '<br>' + resp.methodName + '<br>' +
- JSON.stringify(resp.details, undefined, 2));
- }).catch(function(error) {
- print(error);
- });
- } catch (error) {
- print(error.message);
- }
-}
-
-/**
- * Aborts the current PaymentRequest.
- */
-function abort() { // eslint-disable-line no-unused-vars
- try {
- request.abort().then(function() {
- print('Aborted');
- }).catch(function() {
- print('Cannot abort');
- });
- } catch (error) {
- print(error.message);
- }
-}
« no previous file with comments | « chrome/test/data/android/payments/free_shipping.js ('k') | chrome/test/data/android/payments/name.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698