OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
3 <title>Tests for PaymentRequest interface</title> | 3 <title>Tests for PaymentRequest interface</title> |
4 <script src="../resources/testharness.js"></script> | 4 <script src="../resources/testharness.js"></script> |
5 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
6 <script> | 6 <script> |
7 function substitute(originalObject, substituteKeyValuePairs) { | 7 function substitute(originalObject, substituteKeyValuePairs) { |
8 for (var key in originalObject) { | 8 for (var key in originalObject) { |
9 if (originalObject.hasOwnProperty(key) && substituteKeyValuePairs.hasOwn
Property(key)) { | 9 if (originalObject.hasOwnProperty(key) && substituteKeyValuePairs.hasOwn
Property(key)) { |
10 originalObject[key] = substituteKeyValuePairs[key]; | 10 originalObject[key] = substituteKeyValuePairs[key]; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 }], | 236 }], |
237 ['PaymentRequest constructor should throw for undefined required parameters.
', null, function() { | 237 ['PaymentRequest constructor should throw for undefined required parameters.
', null, function() { |
238 new PaymentRequest(undefined, undefined) | 238 new PaymentRequest(undefined, undefined) |
239 }], | 239 }], |
240 ['PaymentRequest constructor should throw for null required parameter.', nul
l, function() { | 240 ['PaymentRequest constructor should throw for null required parameter.', nul
l, function() { |
241 new PaymentRequest(null, null) | 241 new PaymentRequest(null, null) |
242 }], | 242 }], |
243 ['Empty list of supported payment method identifiers should throw TypeError.
', new TypeError(), function() { | 243 ['Empty list of supported payment method identifiers should throw TypeError.
', new TypeError(), function() { |
244 new PaymentRequest([], buildDetails()) | 244 new PaymentRequest([], buildDetails()) |
245 }], | 245 }], |
| 246 ['Empty supported payment method identifiers should throw TypeError.', null,
function() { |
| 247 new PaymentRequest([{'supportedMethods': []}], buildDetails()) |
| 248 }], |
246 ['Empty details should throw', null, function() { | 249 ['Empty details should throw', null, function() { |
247 new PaymentRequest([{'supportedMethods': ['foo']}], {}) | 250 new PaymentRequest([{'supportedMethods': ['foo']}], {}) |
248 }], | 251 }], |
249 ['Null items should throw', new TypeError(), function() { | 252 ['Null items should throw', new TypeError(), function() { |
250 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'displayItems': null}); | 253 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'displayItems': null}); |
251 }], | 254 }], |
252 ['Null shipping options should throw', new TypeError(), function() { | 255 ['Null shipping options should throw', new TypeError(), function() { |
253 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'displayItems': [buildItem()], 'shippingOptions': null}); | 256 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'displayItems': [buildItem()], 'shippingOptions': null}); |
254 }], | 257 }], |
255 | 258 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 }], | 344 }], |
342 ['Null amount should throw', null, function() { | 345 ['Null amount should throw', null, function() { |
343 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det
ailNames[i], {'value': null})) | 346 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det
ailNames[i], {'value': null})) |
344 }], | 347 }], |
345 ['Undefined amount should throw', null, function() { | 348 ['Undefined amount should throw', null, function() { |
346 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det
ailNames[i], {'value': undefined})) | 349 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det
ailNames[i], {'value': undefined})) |
347 }], | 350 }], |
348 ]); | 351 ]); |
349 } | 352 } |
350 </script> | 353 </script> |
OLD | NEW |