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

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

Issue 2449943002: Add pending line item support for web payments. (Closed)
Patch Set: Comments Created 4 years, 2 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/dynamic_shipping.js
diff --git a/chrome/test/data/android/payments/dynamic_shipping.js b/chrome/test/data/android/payments/dynamic_shipping.js
index 24a5fd8e3f6673063c5bfa82c8a07606523493dd..f02c6fa03b979758fd9252691906a9781227f59e 100644
--- a/chrome/test/data/android/payments/dynamic_shipping.js
+++ b/chrome/test/data/android/payments/dynamic_shipping.js
@@ -15,8 +15,17 @@ function buy() { // eslint-disable-line no-unused-vars
try {
var details = {
total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
- displayItems:
- [{label: 'Subtotal', amount: {currency: 'USD', value: '5.00'}}]
+ displayItems: [
+ {
+ label: 'Pending shipping price',
+ amount: {currency: 'USD', value: '0.00'},
+ pending: true
+ },
+ {
+ label: 'Subtotal',
+ amount: {currency: 'USD', value: '5.00'}
+ }
+ ]
};
var request = new PaymentRequest(
@@ -76,11 +85,7 @@ function updateDetails(details, addr) {
shippingOption.amount.value = '5.00';
details.total.amount.value = '10.00';
}
- if (details.displayItems.length === 1) {
- details.displayItems.splice(0, 0, shippingOption);
- } else {
- details.displayItems.splice(0, 1, shippingOption);
- }
+ details.displayItems.splice(0, 1, shippingOption);
details.shippingOptions = [shippingOption];
} else {
delete details.shippingOptions;

Powered by Google App Engine
This is Rietveld 408576698