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

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

Issue 2500183002: Do not parse JSON in the browser. (Closed)
Patch Set: Use a Dictionary type in IDL Created 4 years, 1 month 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 | « components/payments/payment_request.mojom ('k') | third_party/WebKit/Source/modules/modules_idl_files.gni » ('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 8e246a5954b85bc291d77e6b7f0cf009cc2716a1..aa44b1f22c1695c0a8505a4dc2ad13cb1d64e17b 100644
--- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
+++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
@@ -261,6 +261,22 @@ test(function() {
new PaymentRequest([{'supportedMethods': ['foo']}], {'total': buildItem(), 'modifiers': [{'supportedMethods': ['foo']}, {'supportedMethods': ['foo']}]});
}, 'Duplicate supported payment method identifiers in modifiers should not throw.');
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['https://android.com/pay'], 'data': {'environment': 'TEST', 'merchantName': 'Merchant Inc', 'merchantId': '123', 'allowedCardNetworks': ['AMEX', 'DISCOVER', 'MASTERCARD', 'VISA'], 'paymentMethodTokenizationParameters': {'tokenizationType': 'GATEWAY_TOKEN', 'parameters': {'key': 'value'}}}}], buildDetails());
+}, 'Android Pay parameters for test environment with gateway token should not throw.');
+
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['https://android.com/pay'], 'data': {'environment': 'PRODUCTION', 'merchantName': 'Merchant Inc', 'merchantId': '123', 'allowedCardNetworks': ['AMEX', 'DISCOVER', 'MASTERCARD', 'VISA'], 'paymentMethodTokenizationParameters': {'tokenizationType': 'NETWORK_TOKEN', 'parameters': {'key': 'value'}}}}], buildDetails());
+}, 'Android Pay parameters for produciton environment with network token should not throw.');
+
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['https://android.com/pay'], 'data': {'merchantName': 'Merchant Inc', 'merchantId': '123', 'allowedCardNetworks': ['AMEX', 'DISCOVER', 'MASTERCARD', 'VISA'], 'paymentMethodTokenizationParameters': {'tokenizationType': 'NETWORK_TOKEN', 'parameters': {'key': 'value'}}}}], buildDetails());
+}, 'Android Pay parameters for network token without environment key should not throw.');
+
+test(function() {
+ new PaymentRequest([{'supportedMethods': ['https://android.com/pay'], 'data': {'merchantName': []}}], buildDetails());
+}, 'Invalid Android Pay parameters 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');
« no previous file with comments | « components/payments/payment_request.mojom ('k') | third_party/WebKit/Source/modules/modules_idl_files.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698