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, substituteKeyValuePair) { | 7 function substitute(originalObject, substituteKeyValuePair) { |
8 for (var key in originalObject) { | 8 for (var key in originalObject) { |
9 if (originalObject.hasOwnProperty(key) && substituteKeyValuePair.hasOwnP roperty(key)) { | 9 if (originalObject.hasOwnProperty(key) && substituteKeyValuePair.hasOwnP roperty(key)) { |
10 originalObject[key] = substituteKeyValuePair[key]; | 10 originalObject[key] = substituteKeyValuePair[key]; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 generate_tests(assert_throws, [ | 117 generate_tests(assert_throws, [ |
118 ['PaymentRequest constructor should throw for incorrect parameter types.', n ull, function() { | 118 ['PaymentRequest constructor should throw for incorrect parameter types.', n ull, function() { |
119 new PaymentRequest('', '', '', '') | 119 new PaymentRequest('', '', '', '') |
120 }], | 120 }], |
121 ['PaymentRequest constructor should throw for undefined required parameters. ', null, function() { | 121 ['PaymentRequest constructor should throw for undefined required parameters. ', null, function() { |
122 new PaymentRequest(undefined, undefined) | 122 new PaymentRequest(undefined, undefined) |
123 }], | 123 }], |
124 ['PaymentRequest constructor should throw for null required parameter.', nul l, function() { | 124 ['PaymentRequest constructor should throw for null required parameter.', nul l, function() { |
125 new PaymentRequest(null, null) | 125 new PaymentRequest(null, null) |
126 }], | 126 }], |
127 ['Empty list of supported payment method identifiers should throw.', null, f unction() { | 127 ['Empty list of supported payment method identifiers should throw TypeError. ', {name: 'TypeError'}, function() { |
Marijn Kruisselbrink
2016/05/31 22:11:24
I believe it's slightly more common to write asser
please use gerrit instead
2016/05/31 23:20:32
Done.
| |
128 new PaymentRequest([], buildDetails()) | 128 new PaymentRequest([], buildDetails()) |
129 }], | 129 }], |
130 ['Keys in payment method specific data object should match accepted method i dentifiers.', null, function() { | 130 ['Keys in payment method specific data object should match accepted method i dentifiers.', null, function() { |
131 new PaymentRequest(['foo'], buildDetails(), {}, {'bar': {'gateway': 'baz '}}) | 131 new PaymentRequest(['foo'], buildDetails(), {}, {'bar': {'gateway': 'baz '}}) |
132 }], | 132 }], |
133 ['Empty details should throw', null, function() { | 133 ['Empty details should throw', null, function() { |
134 new PaymentRequest(['foo'], {}) | 134 new PaymentRequest(['foo'], {}) |
135 }], | 135 }], |
136 ['Empty items should throw', null, function() { | 136 ['Empty items should throw', null, function() { |
137 new PaymentRequest(['foo'], {'items': []}) | 137 new PaymentRequest(['foo'], {'items': []}) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 }], | 233 }], |
234 ['Null amount should throw', null, function() { | 234 ['Null amount should throw', null, function() { |
235 new PaymentRequest(['foo'], buildDetails(detailNames[i], {'value': n ull})) | 235 new PaymentRequest(['foo'], buildDetails(detailNames[i], {'value': n ull})) |
236 }], | 236 }], |
237 ['Undefined amount should throw', null, function() { | 237 ['Undefined amount should throw', null, function() { |
238 new PaymentRequest(['foo'], buildDetails(detailNames[i], {'value': u ndefined})) | 238 new PaymentRequest(['foo'], buildDetails(detailNames[i], {'value': u ndefined})) |
239 }], | 239 }], |
240 ]); | 240 ]); |
241 } | 241 } |
242 </script> | 242 </script> |
OLD | NEW |