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

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

Issue 2030193002: Add 'total' field to 'PaymentDetails'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, address comments, and add more tests 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
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/test/data/android/payments/free_shipping.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 75f62a698f6e7fe5e886b60c635f057f77136136..311353151308b29091920b1aa021e501be4272ff 100644
--- a/chrome/test/data/android/payments/dynamic_shipping.js
+++ b/chrome/test/data/android/payments/dynamic_shipping.js
@@ -14,18 +14,9 @@
function buy() { // eslint-disable-line no-unused-vars
try {
var details = {
- displayItems: [
- {
- id: 'sub',
- label: 'Subtotal',
- amount: {currency: 'USD', value: '5.00'}
- },
- {
- id: 'total',
- label: 'Total',
- amount: {currency: 'USD', value: '5.00'}
- }
- ]
+ total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}},
+ displayItems:
+ [{label: 'Subtotal', amount: {currency: 'USD', value: '5.00'}}]
};
var request =
@@ -76,18 +67,17 @@ function updateDetails(details, addr) {
if (addr.administrativeArea === 'CA') {
shippingOption.id = 'ca';
shippingOption.label = 'Free shipping in California';
- details.displayItems[details.displayItems.length - 1].amount.value =
- '5.00';
+ details.total.amount.value = '5.00';
} else {
shippingOption.id = 'us';
shippingOption.label = 'Standard shipping in US';
shippingOption.amount.value = '5.00';
- details.items[details.items.length - 1].amount.value = '10.00';
+ details.total.amount.value = '10.00';
}
- if (details.items.length === 3) {
- details.items.splice(-1, 0, shippingOption);
+ if (details.displayItems.length === 1) {
+ details.displayItems.splice(0, 0, shippingOption);
} else {
- details.items.splice(-2, 1, shippingOption);
+ details.displayItems.splice(0, 1, shippingOption);
}
details.shippingOptions = [shippingOption];
} else {
« no previous file with comments | « chrome/android/java_sources.gni ('k') | chrome/test/data/android/payments/free_shipping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698