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

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

Issue 1753543002: PaymentRequest Mojo bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface
Patch Set: Created 4 years, 9 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 ebdc020c78510dc434e5224feb73f5dc642b4b3e..aec615477ec83f83b2b8bc812ba391466da22eff 100644
--- a/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
+++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
@@ -5,23 +5,23 @@
<script src="../resources/testharnessreport.js"></script>
<script>
test(function() {
- new PaymentRequest([], {}, {}, {});
+ new PaymentRequest(["foo"], {}, {}, {});
}, 'Creating a PaymentRequest with empty parameters should not throw or crash.');
test(function() {
- new PaymentRequest([], {}, {}, {}, '');
+ new PaymentRequest(["foo"], {}, {}, {}, '');
}, 'Creating a PaymentRequest with extra parameters should not throw or crash.');
test(function() {
- new PaymentRequest([], {});
+ new PaymentRequest(["foo"], {});
}, 'Creating a PaymentRequest with omitted optional parameters should not throw or crash.');
test(function() {
- new PaymentRequest([], {}, undefined, undefined);
+ new PaymentRequest(["foo"], {}, undefined, undefined);
}, 'Creating a PaymentRequest with undefined optional parameters should not throw or crash.');
test(function() {
- new PaymentRequest([], {}, null, null);
+ new PaymentRequest(["foo"], {}, null, null);
}, 'Creating a PaymentRequest with null optional parameters should not throw or crash.');
generate_tests(assert_throws, [
@@ -37,27 +37,40 @@ generate_tests(assert_throws, [
]);
test(function() {
- var request = new PaymentRequest([], {});
+ var request = new PaymentRequest(["foo"], {});
assert_readonly(request, "shippingAddress", 'PaymentRequest should have a readonly shippingAddress property.');
assert_readonly(request, "shippingOption", 'PaymentRequest should have a readonly shippingOption property.');
}, 'PaymentRequest should have readonly shippingAddress and shippingOption properties.');
test(function() {
- var request = new PaymentRequest([], {});
+ var request = new PaymentRequest(["foo"], {});
assert_not_equals(request.onshippingaddresschange, undefined, 'PaymentRequest should have onShippingAddressChange event.');
assert_not_equals(request.onshippingoptionchange, undefined, 'PaymentRequest should have onShippingOptionChange event.');
}, 'PaymentRequest should have onShippingAddressChange and onShippingOptionChange events.');
test(function() {
- var request = new PaymentRequest([], {});
+ var request = new PaymentRequest(["foo"], {});
assert_not_equals(request.abort, undefined, 'PaymentRequest should have abort() method.');
assert_not_equals(request.show, undefined, 'PaymentRequest should have show() method.');
}, 'PaymentRequest should have methods abort() and show().');
test(function() {
- var request = new PaymentRequest([], {});
- request.abort();
+ var request = new PaymentRequest(["foo"], {});
request.show();
+ request.abort();
}, 'PaymentRequest.abort() and PaymentRequest.show() should take no parameters.');
+
+test(function() {
+ var request = new PaymentRequest(
+ ["foo"],
+ {
+ "items": [{"id": "total", "label": "Total", "amount": {"currencyCode": "USD", "value": "10.00"}}],
+ "shippingOptions": [{"id": "self", "label": "Pick up", "amount": {"currencyCode": "USD", "value": "-5.00"}}]
+ },
+ {"requestShipping": true},
+ {"foo": {"gateway": "bar"}});
+ request.show();
+ request.abort();
+}, 'Valid data causes no errors.');
</script>

Powered by Google App Engine
This is Rietveld 408576698