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

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

Issue 2048823004: PaymentRequest.abort() should return a promise. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DummyPageHolder and TrackExceptionState for haraken@ comment. Created 4 years, 6 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
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..26c8b5c112366f49f42e0c4ac0e932868780948f
--- /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(
+ [{supportedMethods: ['visa']}],
+ {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}});
+ request.show();
+ } catch (error) {
+ 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);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698