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

Unified Diff: chrome/test/data/android/payments/payment_request_need_address_test.html

Issue 1931233002: Implement PaymentRequestUpdateEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@explicit-shipping
Patch Set: Created 4 years, 8 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/payment_request_need_address_test.html
diff --git a/chrome/test/data/android/payments/payment_request_free_shipping_test.html b/chrome/test/data/android/payments/payment_request_need_address_test.html
similarity index 75%
copy from chrome/test/data/android/payments/payment_request_free_shipping_test.html
copy to chrome/test/data/android/payments/payment_request_need_address_test.html
index a7ca1fb5e025cc6a335775079b14240db5a1e803..6d1b7d563a7c5b5fa3be6bd239937ec52cac989c 100644
--- a/chrome/test/data/android/payments/payment_request_free_shipping_test.html
+++ b/chrome/test/data/android/payments/payment_request_need_address_test.html
@@ -25,19 +25,25 @@ function toDictionary(addr) {
}
function buy() {
try {
- var request = new PaymentRequest(['visa'], {
+ var details = {
'items' : [ {
'id' : 'total',
'label' : 'Total',
'amount' : {'currencyCode' : 'USD', 'value' : '5.00'}
- } ],
- 'shippingOptions' : [ {
- 'id' : 'freeShippingOption',
- 'label' : 'Free global shipping',
- 'amount' : {'currencyCode' : 'USD', 'value' : '0'}
} ]
- },
- {'requestShipping' : true});
+ };
+ var request =
+ new PaymentRequest(['visa'], details, {'requestShipping' : true});
+ request.addEventListener("shippingaddresschange", function(e) {
+ e.updateWith(new Promise(function(resolve, reject) {
+ details['shippingOptions'] = [ {
+ 'id' : 'calculatedShippingOption',
+ 'label' : 'Standard shipping',
+ 'amount' : {'currencyCode' : 'USD', 'value' : '1.00'}
+ } ];
+ resolve(details);
+ }));
+ });
request.show()
.then(function(resp) {
resp.complete(true)

Powered by Google App Engine
This is Rietveld 408576698