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

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

Issue 2117213003: Duplicate payment method identifiers in methodData and details.modififiers should throw TypeError. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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 29e70b7c11e748af6af07cfe74bb5612a7e5d9b2..15fd1cd45e9b380a585f5e9d4f1bfc80cab75d33 100644
--- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
+++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
@@ -206,6 +206,18 @@ test(function() {
test(function() {
assert_throws(new TypeError(), function() {
+ new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo', 'foo']}]});
+ });
+}, 'Duplicate supported payment method identifiers in modifiers should throw TypeError.');
+
+test(function() {
+ assert_throws(new TypeError(), function() {
+ new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}]});
+ });
+}, 'Duplicate supported payment method identifiers in modifiers should throw TypeError.');
please use gerrit instead 2016/07/06 07:31:56 Can you put your assert_throws() tests together in
pals 2016/07/07 05:14:13 Done.
+
+test(function() {
+ assert_throws(new TypeError(), function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': undefined}]});
});
}, 'Undefined supportedMethods in modifiers should throw TypeError.');
@@ -243,6 +255,12 @@ generate_tests(assert_throws, [
['Empty list of supported payment method identifiers should throw TypeError.', new TypeError(), function() {
new PaymentRequest([], 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(), {})
+ }],
['Empty details should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {})
}],

Powered by Google App Engine
This is Rietveld 408576698