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

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

Issue 2117213003: Duplicate payment method identifiers in methodData and details.modififiers should throw TypeError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments fixed 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 | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('j') | 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698