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

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

Issue 2122843002: Add test case to test that empty supported payment method identifiers throw TypeError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: buildDetails Created 4 years, 5 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, 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
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
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>
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