mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-30 14:17:36 -10:00
41 lines
1.2 KiB
HTML
41 lines
1.2 KiB
HTML
<!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.show() method</title>
|
|
<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';
|
|
|
|
promise_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',
|
|
},
|
|
},
|
|
});
|
|
const result = promise_rejects(t, null, request1.show());
|
|
promise_rejects(t, 'AbortError', request2.show())
|
|
.then(t.step_func(() => request1.abort()));
|
|
return result;
|
|
}, 'If the user agent\'s "payment request is showing" boolean is true, ' +
|
|
'then return a promise rejected with an "AbortError" DOMException.');
|
|
</script>
|