Files
sousa-gecko/testing/web-platform/tests/web-based-payment-handler/payment-app/reject-errors.html
T
Stephen McGruer 140f18c2ac Bug 2029837 [wpt PR 59002] - Payment Handler: Add test for OperationError propagation, a=testonly
Automatic update from web-platform-tests
Payment Handler: Add test for OperationError propagation (#59002)

This change adds a new manual test to verify that if a web-based payment
handler rejects the promise passed to respondWith with an OperationError,
the original PaymentRequest.show() call also rejects with an OperationError.

For other error types (like SyntaxError), show() should still reject with
an AbortError.

Spec: https://github.com/w3c/web-based-payment-handler/issues/428
--

wpt-commits: 5bc484399a7de139464d759716435537e368cc00
wpt-pr: 59002
2026-04-28 18:14:44 +00:00

19 lines
649 B
HTML

<!doctype html>
<meta charset="utf-8">
<title>Reject Error Payment App</title>
<p>Please click one of the buttons below to complete or reject the payment.</p>
<button id="success">Authorize (Success)</button>
<button id="reject-operation-error">Reject with OperationError</button>
<button id="reject-syntax-error">Reject with SyntaxError</button>
<script>
for (const id of ['success', 'reject-operation-error', 'reject-syntax-error']) {
document.getElementById(id).onclick = () => {
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage(id);
}
window.close();
};
}
</script>