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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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() { | 246 ['Empty supported payment method identifiers should throw TypeError.', null,
function() { |
247 new PaymentRequest([{'supportedMethods': []}], buildDetails()) | 247 new PaymentRequest([{'supportedMethods': []}], buildDetails()) |
248 }], | 248 }], |
| 249 ['Duplicate supported payment method identifiers should throw TypeError.', n
ull, function() { |
| 250 new PaymentRequest([{'supportedMethods': ['foo', 'foo']}], buildDetails(
), {}) |
| 251 }], |
| 252 ['Duplicate supported payment method identifiers should throw TypeError.', n
ull, function() { |
| 253 new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods':
['foo']}], buildDetails(), {}) |
| 254 }], |
| 255 ['Duplicate supported payment method identifiers in modifiers should throw T
ypeError.', null, function() { |
| 256 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]}) |
| 257 }], |
| 258 ['Duplicate supported payment method identifiers in modifiers should throw T
ypeError.', null, function() { |
| 259 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'modifiers': [{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}]}) |
| 260 }], |
249 ['Empty details should throw', null, function() { | 261 ['Empty details should throw', null, function() { |
250 new PaymentRequest([{'supportedMethods': ['foo']}], {}) | 262 new PaymentRequest([{'supportedMethods': ['foo']}], {}) |
251 }], | 263 }], |
252 ['Null items should throw', new TypeError(), function() { | 264 ['Null items should throw', new TypeError(), function() { |
253 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'displayItems': null}); | 265 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'displayItems': null}); |
254 }], | 266 }], |
255 ['Null shipping options should throw', new TypeError(), function() { | 267 ['Null shipping options should throw', new TypeError(), function() { |
256 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'displayItems': [buildItem()], 'shippingOptions': null}); | 268 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(
), 'displayItems': [buildItem()], 'shippingOptions': null}); |
257 }], | 269 }], |
258 | 270 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 }], | 356 }], |
345 ['Null amount should throw', null, function() { | 357 ['Null amount should throw', null, function() { |
346 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det
ailNames[i], {'value': null})) | 358 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det
ailNames[i], {'value': null})) |
347 }], | 359 }], |
348 ['Undefined amount should throw', null, function() { | 360 ['Undefined amount should throw', null, function() { |
349 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det
ailNames[i], {'value': undefined})) | 361 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det
ailNames[i], {'value': undefined})) |
350 }], | 362 }], |
351 ]); | 363 ]); |
352 } | 364 } |
353 </script> | 365 </script> |
OLD | NEW |