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

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

Issue 2685343002: Update the shippingType option to not allow invalid strings. (Closed)
Patch Set: layout test Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/payments/PaymentOptions.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/payments/PaymentOptions.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698