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

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

Issue 1702223002: PaymentRequest API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows linking. Created 4 years, 10 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/LayoutTests/webexposed/global-interface-listing-expected.txt » ('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
new file mode 100644
index 0000000000000000000000000000000000000000..ebdc020c78510dc434e5224feb73f5dc642b4b3e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/payments/payment-request-interface.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Tests for PaymentRequest interface</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+ new PaymentRequest([], {}, {}, {});
+}, 'Creating a PaymentRequest with empty parameters should not throw or crash.');
+
+test(function() {
+ new PaymentRequest([], {}, {}, {}, '');
+}, 'Creating a PaymentRequest with extra parameters should not throw or crash.');
+
+test(function() {
+ new PaymentRequest([], {});
+}, 'Creating a PaymentRequest with omitted optional parameters should not throw or crash.');
+
+test(function() {
+ new PaymentRequest([], {}, undefined, undefined);
+}, 'Creating a PaymentRequest with undefined optional parameters should not throw or crash.');
+
+test(function() {
+ new PaymentRequest([], {}, null, null);
+}, 'Creating a PaymentRequest with null optional parameters should not throw or crash.');
+
+generate_tests(assert_throws, [
+ ['PaymentRequest constructor should throw for incorrect parameter types.', null, function() {
+ new PaymentRequest('', '', '', '')
+ }],
+ ['PaymentRequest constructor should throw for undefined required parameters.', null, function() {
+ new PaymentRequest(undefined, undefined)
+ }],
+ ['PaymentRequest constructor should throw for null required parameter.', null, function() {
+ new PaymentRequest(null, null)
+ }]
+]);
+
+test(function() {
+ var request = new PaymentRequest([], {});
+ 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([], {});
+ 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([], {});
+ 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();
+ request.show();
+}, 'PaymentRequest.abort() and PaymentRequest.show() should take no parameters.');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698