| Index: chrome/test/data/android/payments/abort.js
|
| diff --git a/chrome/test/data/android/payments/abort.js b/chrome/test/data/android/payments/abort.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a178c014ec90a56de629177035d5b347c17a9015
|
| --- /dev/null
|
| +++ b/chrome/test/data/android/payments/abort.js
|
| @@ -0,0 +1,38 @@
|
| +/*
|
| + * 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 */
|
| +
|
| +var request;
|
| +
|
| +/**
|
| + * Launches the PaymentRequest UI.
|
| + */
|
| +function buy() { // eslint-disable-line no-unused-vars
|
| + try {
|
| + request = new PaymentRequest(
|
| + ['visa'],
|
| + {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}});
|
| + request.show();
|
| + } catch (error) {
|
| + print(error.message);
|
| + }
|
| +}
|
| +
|
| +/**
|
| + * Aborts they PaymentRequest.
|
| + */
|
| +function abort() { // eslint-disable-line no-unused-vars
|
| + try {
|
| + request.abort().then(() => {
|
| + print('Aborted');
|
| + }).catch(() => {
|
| + print('Cannot abort');
|
| + });
|
| + } catch (error) {
|
| + print(error.message);
|
| + }
|
| +}
|
|
|