| 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 76%
|
| 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 0de48185dcae30cc72fc30f79aa2bc672a5a9ecb..14ac92f6c94700c7193dc42c7b03a10fbb85f06d 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
|
| @@ -1,7 +1,7 @@
|
| <!DOCTYPE html>
|
| <html>
|
| <head>
|
| -<title>Free Shipping Test</title>
|
| +<title>No Shipping Test</title>
|
| <meta charset="utf-8">
|
| <meta name="viewport" content="width=device-width, initial-scale=1">
|
| <style>
|
| @@ -39,19 +39,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)
|
|
|