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

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

Issue 2137953002: Duplicate shipping option identifiers should throw TypeError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch3 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 }], 197 }],
198 ['Empty supported payment method identifiers should throw TypeError.', null, function() { 198 ['Empty supported payment method identifiers should throw TypeError.', null, function() {
199 new PaymentRequest([{'supportedMethods': []}], buildDetails()) 199 new PaymentRequest([{'supportedMethods': []}], buildDetails())
200 }], 200 }],
201 ['Duplicate supported payment method identifiers should throw TypeError.', n ull, function() { 201 ['Duplicate supported payment method identifiers should throw TypeError.', n ull, function() {
202 new PaymentRequest([{'supportedMethods': ['foo', 'foo']}], buildDetails( ), {}) 202 new PaymentRequest([{'supportedMethods': ['foo', 'foo']}], buildDetails( ), {})
203 }], 203 }],
204 ['Duplicate supported payment method identifiers should throw TypeError.', n ull, function() { 204 ['Duplicate supported payment method identifiers should throw TypeError.', n ull, function() {
205 new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {}) 205 new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {})
206 }], 206 }],
207 ['Duplicate shipping option identifiers should throw TypeError.', null, func tion() {
208 var shippingOptions = [buildItem({'id': 'express', 'selected': false}), buildItem({'id': 'express', 'selected': true})];
209 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem( ), 'displayItems': [buildItem()], 'shippingOptions': shippingOptions}, {'request Shipping': true})
210 }],
207 ['Absence of total should throw TypeError.', null, function() { 211 ['Absence of total should throw TypeError.', null, function() {
208 new PaymentRequest([{'supportedMethods': ['foo']}], {'displayItems': [bu ildItem()]}) 212 new PaymentRequest([{'supportedMethods': ['foo']}], {'displayItems': [bu ildItem()]})
209 }], 213 }],
210 ['Negative total value should throw a TypeError.', null, function() { 214 ['Negative total value should throw a TypeError.', null, function() {
211 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails('total' , {'value': '-0.01'})) 215 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails('total' , {'value': '-0.01'}))
212 }], 216 }],
213 ['Duplicate supported payment method identifiers in modifiers should throw T ypeError.', null, function() { 217 ['Duplicate supported payment method identifiers in modifiers should throw T ypeError.', null, function() {
214 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem( ), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]}) 218 new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem( ), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]})
215 }], 219 }],
216 ['Duplicate supported payment method identifiers in modifiers should throw T ypeError.', null, function() { 220 ['Duplicate supported payment method identifiers in modifiers should throw T ypeError.', null, function() {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 }], 336 }],
333 ['Null amount should throw', null, function() { 337 ['Null amount should throw', null, function() {
334 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det ailNames[i], {'value': null})) 338 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det ailNames[i], {'value': null}))
335 }], 339 }],
336 ['Undefined amount should throw', null, function() { 340 ['Undefined amount should throw', null, function() {
337 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det ailNames[i], {'value': undefined})) 341 new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(det ailNames[i], {'value': undefined}))
338 }], 342 }],
339 ]); 343 ]);
340 } 344 }
341 </script> 345 </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