| Index: chrome/test/data/android/payments/payment_request_free_shipping_test.html
|
| diff --git a/chrome/test/data/android/payments/payment_request_free_shipping_test.html b/chrome/test/data/android/payments/payment_request_free_shipping_test.html
|
| index 1eb7ab9d8e673741794bf3d8b665a4ef4dc77f78..5aa5c0f755554edfcc63ac8ed56fde3df33d441e 100644
|
| --- a/chrome/test/data/android/payments/payment_request_free_shipping_test.html
|
| +++ b/chrome/test/data/android/payments/payment_request_free_shipping_test.html
|
| @@ -1,74 +1,20 @@
|
| <!DOCTYPE html>
|
| +<!--
|
| +Copyright 2016 The Chromium Authors. All rights reserved.
|
| +Use of this source code is governed by a BSD-style license that can be
|
| +found in the LICENSE file.
|
| +-->
|
| <html>
|
| <head>
|
| <title>Free Shipping Test</title>
|
| <meta charset="utf-8">
|
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
| -<style>
|
| -button {
|
| - width: 100%;
|
| - height: 5em;
|
| - font-size: 3em;
|
| -}
|
| -</style>
|
| +<link rel="stylesheet" type="text/css" href="style.css">
|
| </head>
|
| <body>
|
| <button onclick="buy()" id="buy">Free Shipping Test</button>
|
| -<script>
|
| -function print(msg) {
|
| - document.open();
|
| - document.write('<pre id="result" style="font-size: 2em;">' + msg + '</pre>');
|
| - document.close();
|
| -}
|
| -function toDictionary(addr) {
|
| - var dict = {};
|
| - if (addr) {
|
| - dict.regionCode = addr.regionCode;
|
| - dict.administrativeArea = addr.administrativeArea;
|
| - dict.locality = addr.locality;
|
| - dict.dependentLocality = addr.dependentLocality;
|
| - dict.addressLine = addr.addressLine;
|
| - dict.postalCode = addr.postalCode;
|
| - dict.sortingCode = addr.sortingCode;
|
| - dict.languageCode = addr.languageCode;
|
| - dict.organization = addr.organization;
|
| - dict.recipient = addr.recipient;
|
| - }
|
| - return dict;
|
| -}
|
| -function buy() {
|
| - try {
|
| - var request = new PaymentRequest(['visa'], {
|
| - 'items' : [ {
|
| - 'id' : 'total',
|
| - 'label' : 'Total',
|
| - 'amount' : {'currency' : 'USD', 'value' : '5.00'}
|
| - } ],
|
| - 'shippingOptions' : [ {
|
| - 'id' : 'freeShippingOption',
|
| - 'label' : 'Free global shipping',
|
| - 'amount' : {'currency' : 'USD', 'value' : '0'}
|
| - } ]
|
| - }, {
|
| - 'requestShipping' : true
|
| - });
|
| - request.show()
|
| - .then(function(resp) {
|
| - resp.complete(true)
|
| - .then(function() {
|
| - print(request.shippingOption + '<br>' +
|
| - JSON.stringify(toDictionary(request.shippingAddress),
|
| - undefined, 2) +
|
| - '<br>' + resp.methodName + '<br>' +
|
| - JSON.stringify(resp.details, undefined, 2));
|
| - })
|
| - .catch(function(error) { print(error.message); });
|
| - })
|
| - .catch(function(error) { print(error.message); });
|
| - } catch (error) {
|
| - print(error.message);
|
| - }
|
| -}
|
| -</script>
|
| +<pre id="result"></pre>
|
| +<script src="util.js"></script>
|
| +<script src="free_shipping.js"></script>
|
| </body>
|
| </html>
|
|
|