Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/payments/payment-request-interface.html |
| diff --git a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html |
| index 5f82a3aa7e6a2c5c3d7e4c0930cf24b28ad08efd..5e9a8312e9636db86760d39df97715108b7eea3c 100644 |
| --- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html |
| +++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html |
| @@ -192,36 +192,11 @@ test(function() { |
| }, 'Shipping type should be \'pickup\' if shipping type is specified as \'pickup\'.'); |
| test(function() { |
| - var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': 'invalid'}); |
| - assert_equals('shipping', request.shippingType); |
| -}, 'Shipping type should be \'shipping\' if shipping type is specified as invalid string.'); |
| - |
| -test(function() { |
| - var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': null}); |
| - assert_equals('shipping', request.shippingType); |
| -}, 'Shipping type should be \'shipping\' if shipping type is specified as null.'); |
| - |
| -test(function() { |
| var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': undefined}); |
| assert_equals('shipping', request.shippingType); |
| }, 'Shipping type should be \'shipping\' if shipping type is specified as undefined.'); |
| test(function() { |
| - var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': []}); |
| - assert_equals('shipping', request.shippingType); |
| -}, 'Shipping type should be \'shipping\' if shipping type is specified as [].'); |
| - |
| -test(function() { |
| - var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': {}}); |
| - assert_equals('shipping', request.shippingType); |
| -}, 'Shipping type should be \'shipping\' if shipping type is specified as {}.'); |
| - |
| -test(function() { |
| - var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': 0}); |
| - assert_equals('shipping', request.shippingType); |
| -}, 'Shipping type should be \'shipping\' if shipping type is specified as a number.'); |
| - |
| -test(function() { |
| new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'displayItems': undefined}); |
| }, 'Undefined display items should not throw.'); |
| @@ -350,6 +325,21 @@ generate_tests(assert_throws, [ |
| ['Null shipping options should throw', new TypeError(), function() { |
| new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'displayItems': [buildItem()], 'shippingOptions': null}); |
| }], |
| + ['Undefined PaymentShippingType value for shppingType should throw a TypeError', new TypeError(), function() { |
|
foolip
2017/02/14 13:32:05
This test does not test undefined, but an invalid
|
| + var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': 'invalid'}); |
| + }], |
| + ['Null for shppingType should throw a TypeError', new TypeError(), function() { |
| + var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': null}); |
| + }], |
| + ['Array value for shppingType should throw a TypeError', new TypeError(), function() { |
| + var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': []}); |
| + }], |
| + ['Object value for shppingType should throw a TypeError', new TypeError(), function() { |
| + var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': {}}); |
| + }], |
| + ['Numeric value for shppingType should throw a TypeError', new TypeError(), function() { |
| + var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': true, 'shippingType': 0}); |
| + }], |
| // Payment method specific data should be a JSON-serializable object. |
| ['Array value for payment method specific data parameter should throw', null, function() { |