Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: third_party/WebKit/LayoutTests/payments/payment-request-interface.html

Issue 2022283004: Empty list of payment methods should throw TypeError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New TypeError Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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. ', new TypeError(), function() {
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
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>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698