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
19 lines
649 B
HTML
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>
|