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

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

Issue 2451873003: Allow duplicate payment method identifiers. (Closed)
Patch Set: Make modifier total optional 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 07d3abe0f72803c48fea4cd7e9159d567d056dc3..8e246a5954b85bc291d77e6b7f0cf009cc2716a1 100644
--- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
+++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
@@ -245,6 +245,22 @@ test(function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo'], 'total': buildItem({'value': '0.0'})}]});
}, 'Non-negative total value in PaymentDetailsModifier should not throw.');
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['foo', 'foo']}], buildDetails(), {});
+}, 'Duplicate supported payment method identifiers should not throw.');
+
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {});
+}, 'Duplicate supported payment method identifiers should not throw.');
+
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]});
+}, 'Duplicate supported payment method identifiers in modifiers should not throw.');
+
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}]});
+}, 'Duplicate supported payment method identifiers in modifiers should not throw.');
+
promise_test(function(t) {
return promise_rejects(t, null, new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails()).abort());
}, 'abort() without show() should reject with error');
@@ -265,24 +281,12 @@ generate_tests(assert_throws, [
['Empty supported payment method identifiers should throw TypeError.', null, function() {
new PaymentRequest([{'supportedMethods': []}], buildDetails())
}],
- ['Duplicate supported payment method identifiers should throw TypeError.', null, function() {
- new PaymentRequest([{'supportedMethods': ['foo', 'foo']}], buildDetails(), {})
- }],
- ['Duplicate supported payment method identifiers should throw TypeError.', null, function() {
- new PaymentRequest([{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}], buildDetails(), {})
- }],
['Absence of total should throw TypeError.', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'displayItems': [buildItem()]})
}],
['Negative total value should throw a TypeError.', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], buildDetails('total', {'value': '-0.01'}))
}],
- ['Duplicate supported payment method identifiers in modifiers should throw TypeError.', null, function() {
- new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]})
- }],
- ['Duplicate supported payment method identifiers in modifiers should throw TypeError.', null, function() {
- new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}]})
- }],
['Negative total value in PaymentDetailsModifier should throw a TypeError.', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo'], 'total': buildItem({'value': '-0.01'})}]})
}],
« no previous file with comments | « components/payments/payment_request.mojom ('k') | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698