OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 <script src="../resources/mojo-helpers.js"></script> | 4 <script src="../resources/mojo-helpers.js"></script> |
5 <script src="resources/payment-request-mock.js"></script> | 5 <script src="resources/payment-request-mock.js"></script> |
6 <script> | 6 <script> |
7 var details = { | 7 var details = { |
8 total: | 8 total: |
9 { | 9 { |
10 label: 'Total', | 10 label: 'Total', |
(...skipping 12 matching lines...) Expand all Loading... |
23 var completeResult; | 23 var completeResult; |
24 return paymentRequestMock | 24 return paymentRequestMock |
25 .then(m => { | 25 .then(m => { |
26 mock = m; | 26 mock = m; |
27 var result = new PaymentRequest([{'supportedMethods': ['visa']}], deta
ils).show(); | 27 var result = new PaymentRequest([{'supportedMethods': ['visa']}], deta
ils).show(); |
28 gc(); | 28 gc(); |
29 mock.onPaymentResponse(response_data); | 29 mock.onPaymentResponse(response_data); |
30 return result; | 30 return result; |
31 }) | 31 }) |
32 .then(response => { | 32 .then(response => { |
33 completeResult = response.complete(true); | 33 completeResult = response.complete("success"); |
34 // Return before calling gc() to make sure reference to response | 34 // Return before calling gc() to make sure reference to response |
35 // is gone. | 35 // is gone. |
36 }) | 36 }) |
37 .then(() => { | 37 .then(() => { |
38 gc(); | 38 gc(); |
39 mock.onComplete(); | 39 mock.onComplete(); |
40 return completeResult; | 40 return completeResult; |
41 }); | 41 }); |
42 }, 'Promises resolve even without references to request or response.'); | 42 }, 'Promises resolve even without references to request or response.'); |
43 </script> | 43 </script> |
OLD | NEW |