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

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

Issue 2406713002: PaymentRequest: Ignore shipping options if there are duplicated IDs. (Closed)
Patch Set: presubmit Created 4 years, 2 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
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 cda7c6a1ad3dc77d1a5f8c659f99f889d4f0e479..07d3abe0f72803c48fea4cd7e9159d567d056dc3 100644
--- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
+++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
@@ -156,6 +156,12 @@ test(function() {
}, 'Shipping option identifier should default to the last selected shipping option, if multiple are selected.');
test(function() {
+ var shippingOptions = [buildItem({'id': 'express', 'selected': false}), buildItem({'id': 'express', 'selected': true})];
+ var request = new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'displayItems': [buildItem()], 'shippingOptions': shippingOptions}, {'requestShipping': true});
+ assert_equals(null, request.shippingOption);
+}, 'No shipping option selected for duplicate shipping option identifiers.');
+
+test(function() {
var request = new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails(), {'requestShipping': false});
assert_equals(null, request.shippingType);
}, 'Shipping type should be null if shipping is explicitly not requested.');
@@ -265,10 +271,6 @@ generate_tests(assert_throws, [
['Duplicate supported payment method identifiers should throw TypeError.', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {})
}],
- ['Duplicate shipping option identifiers should throw TypeError.', null, function() {
- var shippingOptions = [buildItem({'id': 'express', 'selected': false}), buildItem({'id': 'express', 'selected': true})];
- new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'displayItems': [buildItem()], 'shippingOptions': shippingOptions}, {'requestShipping': true})
- }],
['Absence of total should throw TypeError.', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'displayItems': [buildItem()]})
}],

Powered by Google App Engine
This is Rietveld 408576698