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

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

Issue 2236933007: Always fire 'shippingaddresschange' event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: @link 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/android/payments/free_shipping.js
diff --git a/chrome/test/data/android/payments/free_shipping.js b/chrome/test/data/android/payments/free_shipping.js
index dab9949c1c36e4e52bb102e1cc229aafdb191873..a3ec6d4f3094f2cbc4c9e566d17c5d087401c777 100644
--- a/chrome/test/data/android/payments/free_shipping.js
+++ b/chrome/test/data/android/payments/free_shipping.js
@@ -6,23 +6,31 @@
/* global PaymentRequest:false */
/* global toDictionary:false */
+/* global print:false */
/**
* Launches the PaymentRequest UI that offers free shipping worldwide.
*/
function buy() { // 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
+ }]
+ };
var 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
- }]
- },
+ [{supportedMethods: ['visa']}], details,
{requestShipping: true});
+ request.addEventListener('shippingaddresschange', function(e) {
+ e.updateWith(new Promise(function(resolve) {
+ // No changes in price based on shipping address change.
+ resolve(details);
+ }));
+ });
request.show()
.then(function(resp) {
resp.complete('success')
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698