Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-show-method.https.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-show-method.https.html b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-show-method.https.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f03a0c7e100098be639a60ce2199c82283bb5c04 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-request/payment-request-show-method.https.html |
| @@ -0,0 +1,42 @@ |
| +<!DOCTYPE html> |
| +<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). --> |
| +<meta charset="utf-8"> |
| +<title>Test for PaymentRequest Constructor</title> |
|
Marijn Kruisselbrink
2017/05/05 17:53:19
copy/past error?
please use gerrit instead
2017/05/05 18:16:33
Done.
|
| +<link rel="help" href="https://w3c.github.io/browser-payment-api/#show-method"> |
| +<script src="/resources/testharness.js"></script> |
| +<script src="/resources/testharnessreport.js"></script> |
| +<script> |
| +'use strict'; |
| + |
| +async_test(t => { |
| + const request1 = new PaymentRequest([{ |
| + supportedMethods: ['basic-card'], |
| + }], { |
| + total: { |
| + label: 'request1', |
| + amount: { |
| + currency: 'USD', |
| + value: '1.00', |
| + }, |
| + }, |
| + }); |
| + const request2 = new PaymentRequest([{ |
| + supportedMethods: ['basic-card'], |
| + }], { |
| + total: { |
| + label: 'request2', |
| + amount: { |
| + currency: 'USD', |
| + value: '1.00', |
| + }, |
| + }, |
| + }); |
| + request1.show().catch(t.step_func_done()); |
| + request2.show().catch(t.step_func(e => { |
|
Marijn Kruisselbrink
2017/05/05 17:53:19
you could rewrite this part as:
promise_rejects(t,
please use gerrit instead
2017/05/05 18:16:33
Done.
|
| + assert_equals(Object.prototype.toString.call(e), '[object DOMException]'); |
| + assert_equals(e.name, 'AbortError'); |
| + request1.abort(); |
| + })); |
| +}, 'If the user agent\'s "payment request is showing" boolean is true, ' + |
| + 'then return a promise rejected with an "AbortError" DOMException.'); |
| +</script> |