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

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

Issue 2851383002: Verify behavior of PaymentRequest constructor. (Closed)
Patch Set: Comments Created 3 years, 7 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 a0b338f680b5a0b6b085b7648ab80de32b15d22e..8ebb2c22484130f86d6a267991b8d3af0e9debc2 100644
--- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
+++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
@@ -272,6 +272,10 @@ test(function() {
new PaymentRequest([{'supportedMethods': ['https://android.com/pay'], 'data': {'allowedCardNetworks': 0}}], buildDetails());
}, 'Invalid Android Pay parameters should not throw even when method name is "https://android.com/pay".');
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['foo'], 'data': []}], buildDetails());
+}, 'Array value for payment method specific data parameter 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');
@@ -313,9 +317,6 @@ generate_tests(assert_throws, [
['Absence of supportedMethods in modifiers should throw TypeError.', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'total': buildItem()}]})
}],
- ['Empty modifiers should throw TypeError.', null, function() {
- new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': []})
- }],
['Empty details should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {})
}],
@@ -342,9 +343,6 @@ generate_tests(assert_throws, [
}],
// Payment method specific data should be a JSON-serializable object.
- ['Array value for payment method specific data parameter should throw', null, function() {
- new PaymentRequest([{'supportedMethods': ['foo'], 'data': []}], buildDetails(), {})
- }],
['String value for payment method specific data parameter should throw', null, function() {
new PaymentRequest([{'supportedMethods': ['foo'], 'data': 'foo'}], buildDetails(), {})
}],

Powered by Google App Engine
This is Rietveld 408576698