Chromium Code Reviews| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 }], | 258 }], |
| 259 ['Empty supported payment method identifiers should throw TypeError.', null, function() { | 259 ['Empty supported payment method identifiers should throw TypeError.', null, function() { |
| 260 new PaymentRequest([{'supportedMethods': []}], buildDetails()) | 260 new PaymentRequest([{'supportedMethods': []}], buildDetails()) |
| 261 }], | 261 }], |
| 262 ['Duplicate supported payment method identifiers should throw TypeError.', n ull, function() { | 262 ['Duplicate supported payment method identifiers should throw TypeError.', n ull, function() { |
| 263 new PaymentRequest([{'supportedMethods': ['foo', 'foo']}], buildDetails( ), {}) | 263 new PaymentRequest([{'supportedMethods': ['foo', 'foo']}], buildDetails( ), {}) |
| 264 }], | 264 }], |
| 265 ['Duplicate supported payment method identifiers should throw TypeError.', n ull, function() { | 265 ['Duplicate supported payment method identifiers should throw TypeError.', n ull, function() { |
| 266 new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {}) | 266 new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {}) |
| 267 }], | 267 }], |
| 268 ['Duplicate shipping option identifiers should throw TypeError.', null, func tion() { | |
| 269 var shippingOptions = [buildItem({'id': 'express', 'selected': false}), buildItem({'id': 'express', 'selected': true})]; | |
| 270 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem( ), 'displayItems': [buildItem()], 'shippingOptions': shippingOptions}, {'request Shipping': true}) | |
|
please use gerrit instead
2016/10/12 01:28:02
Please add a test 'No shipping option selected for
zino
2016/10/12 18:05:24
Done.
| |
| 271 }], | |
| 272 ['Absence of total should throw TypeError.', null, function() { | 268 ['Absence of total should throw TypeError.', null, function() { |
| 273 new PaymentRequest([{'supportedMethods': ['foo']}], {'displayItems': [bu ildItem()]}) | 269 new PaymentRequest([{'supportedMethods': ['foo']}], {'displayItems': [bu ildItem()]}) |
| 274 }], | 270 }], |
| 275 ['Negative total value should throw a TypeError.', null, function() { | 271 ['Negative total value should throw a TypeError.', null, function() { |
| 276 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails('total' , {'value': '-0.01'})) | 272 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails('total' , {'value': '-0.01'})) |
| 277 }], | 273 }], |
| 278 ['Duplicate supported payment method identifiers in modifiers should throw T ypeError.', null, function() { | 274 ['Duplicate supported payment method identifiers in modifiers should throw T ypeError.', null, function() { |
| 279 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem( ), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]}) | 275 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem( ), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]}) |
| 280 }], | 276 }], |
| 281 ['Duplicate supported payment method identifiers in modifiers should throw T ypeError.', null, function() { | 277 ['Duplicate supported payment method identifiers in modifiers should throw T ypeError.', null, function() { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 }], | 375 }], |
| 380 ['Null amount should throw', null, function() { | 376 ['Null amount should throw', null, function() { |
| 381 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det ailNames[i], {'value': null})) | 377 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det ailNames[i], {'value': null})) |
| 382 }], | 378 }], |
| 383 ['Undefined amount should throw', null, function() { | 379 ['Undefined amount should throw', null, function() { |
| 384 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det ailNames[i], {'value': undefined})) | 380 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det ailNames[i], {'value': undefined})) |
| 385 }], | 381 }], |
| 386 ]); | 382 ]); |
| 387 } | 383 } |
| 388 </script> | 384 </script> |
| OLD | NEW |