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 1938853002: More thorough tests for PaymentRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-output-dir
Patch Set: Address comments Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('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 67516f23f456c2764fdd56fa76e3123f1f414f95..c64c202a3ccba9e214c637c7d252524c567871c3 100644
--- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
+++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
@@ -90,16 +90,26 @@ test(function() {
test(function() {
var request = new PaymentRequest(['foo'], buildDetails('shippingOptions', {'id': 'standard'}));
+ assert_equals(null, request.shippingOption);
+}, 'Shipping option identifier should be null if shipping request is omitted.');
+
+test(function() {
+ var request = new PaymentRequest(['foo'], buildDetails('shippingOptions', {'id': 'standard'}), {'requestShipping': false});
+ assert_equals(null, request.shippingOption);
+}, 'Shipping option identifier should be null if shipping is explicitly not requested.');
+
+test(function() {
+ var request = new PaymentRequest(['foo'], buildDetails('shippingOptions', {'id': 'standard'}), {'requestShipping': true});
assert_equals('standard', request.shippingOption);
}, 'Shipping option identifier should default to the single provided option.');
test(function() {
- var request = new PaymentRequest(['foo'], {"items": [buildItem()]});
+ var request = new PaymentRequest(['foo'], {"items": [buildItem()]}, {'requestShipping': true});
assert_equals(null, request.shippingOption);
}, 'Shipping option identifier should be null when no shipping options are provided.');
test(function() {
- var request = new PaymentRequest(['foo'], {'items': [buildItem()], 'shippingOptions': [buildItem({'id': 'standard'}), buildItem({'id': 'express'})]});
+ var request = new PaymentRequest(['foo'], {'items': [buildItem()], 'shippingOptions': [buildItem({'id': 'standard'}), buildItem({'id': 'express'})]}, {'requestShipping': true});
assert_equals(null, request.shippingOption);
}, 'Shipping option identifier should be null at first when multiple shipping options are provided.');
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/payments/PaymentRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698