diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 4e0591fd9b9e..a152e4944e95 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -5965,7 +5965,6 @@ pref("dom.timeout.max_consecutive_callbacks_ms", 4); // Use this preference to house "Payment Request API" during development pref("dom.payments.request.enabled", false); pref("dom.payments.loglevel", "Warn"); -pref("dom.payments.unknownTimeoutMS", 5000); #ifdef FUZZING pref("fuzzing.enabled", false); diff --git a/toolkit/components/payments/content/paymentDialogWrapper.js b/toolkit/components/payments/content/paymentDialogWrapper.js index ec167b8cf0b0..707fa9058def 100644 --- a/toolkit/components/payments/content/paymentDialogWrapper.js +++ b/toolkit/components/payments/content/paymentDialogWrapper.js @@ -411,12 +411,6 @@ var paymentDialogWrapper = { }); paymentSrv.respondPayment(showResponse); this.sendMessageToContent("responseSent"); - - // If the merchant has not called response.complete() within unknownTimeoutMS - // then we will close the dialog, treating it the same as if the merchant - // passed "unknown" to response.complete(). - const timeoutMS = Services.prefs.getIntPref("dom.payments.unknownTimeoutMS"); - window.unknownTimeoutId = window.setTimeout(window.close, timeoutMS); }, async onChangeShippingAddress({shippingAddressGUID}) { diff --git a/toolkit/components/payments/paymentUIService.js b/toolkit/components/payments/paymentUIService.js index ba87e7d86496..e9d57d1f99cb 100644 --- a/toolkit/components/payments/paymentUIService.js +++ b/toolkit/components/payments/paymentUIService.js @@ -69,10 +69,6 @@ PaymentUIService.prototype = { completePayment(requestId) { this.log.debug("completePayment:", requestId); - let dialog = this.findDialog(requestId); - if (dialog && dialog.unknownTimeoutId) { - dialog.clearTimeout(dialog.unknownTimeoutId); - } let closed = this.closeDialog(requestId); let responseCode = closed ? Ci.nsIPaymentActionResponse.COMPLETE_SUCCEEDED : diff --git a/toolkit/components/payments/res/containers/payment-dialog.js b/toolkit/components/payments/res/containers/payment-dialog.js index f537328f74fa..ae24ab45283f 100644 --- a/toolkit/components/payments/res/containers/payment-dialog.js +++ b/toolkit/components/payments/res/containers/payment-dialog.js @@ -157,7 +157,6 @@ class PaymentDialog extends PaymentStateSubscriberMixin(HTMLElement) { case "processing": case "success": case "fail": - case "unknown": break; default: throw new Error("Invalid completionState"); diff --git a/toolkit/components/payments/res/debugging.html b/toolkit/components/payments/res/debugging.html index 753804758a4c..e30ba8c0a78c 100644 --- a/toolkit/components/payments/res/debugging.html +++ b/toolkit/components/payments/res/debugging.html @@ -33,7 +33,6 @@ - diff --git a/toolkit/components/payments/res/debugging.js b/toolkit/components/payments/res/debugging.js index 413aedc83c8c..b70d6ca65a03 100644 --- a/toolkit/components/payments/res/debugging.js +++ b/toolkit/components/payments/res/debugging.js @@ -305,12 +305,6 @@ let buttonActions = { completionState: "fail", }); }, - - setStateUnknown() { - requestStore.setState({ - completionState: "unknown", - }); - }, }; window.addEventListener("click", function onButtonClick(evt) { diff --git a/toolkit/components/payments/res/paymentRequest.css b/toolkit/components/payments/res/paymentRequest.css index d607499ebfd8..25fe35f59cff 100644 --- a/toolkit/components/payments/res/paymentRequest.css +++ b/toolkit/components/payments/res/paymentRequest.css @@ -83,7 +83,6 @@ payment-dialog > footer { } payment-dialog[changes-prevented][completion-state="fail"] #pay, -payment-dialog[changes-prevented][completion-state="unknown"] #pay, payment-dialog[changes-prevented][completion-state="processing"] #pay, payment-dialog[changes-prevented][completion-state="success"] #pay { /* Show the pay button above #disabled-overlay */ diff --git a/toolkit/components/payments/res/paymentRequest.xhtml b/toolkit/components/payments/res/paymentRequest.xhtml index 99ce00995cdb..ede856fc6c04 100644 --- a/toolkit/components/payments/res/paymentRequest.xhtml +++ b/toolkit/components/payments/res/paymentRequest.xhtml @@ -15,7 +15,6 @@ - ]> @@ -92,7 +91,6 @@ data-initial-label="&approvePaymentButton.label;" data-processing-label="&processingPaymentButton.label;" data-fail-label="&failPaymentButton.label;" - data-unknown-label="&unknownPaymentButton.label;" data-success-label="&successPaymentButton.label;"> diff --git a/toolkit/components/payments/test/browser/browser.ini b/toolkit/components/payments/test/browser/browser.ini index 867c24c9569c..1d19113ed09e 100644 --- a/toolkit/components/payments/test/browser/browser.ini +++ b/toolkit/components/payments/test/browser/browser.ini @@ -2,7 +2,6 @@ head = head.js prefs = dom.payments.request.enabled=true - dom.payments.unknownTimeoutMS=0 skip-if = !e10s # Bug 1365964 - Payment Request isn't implemented for non-e10s support-files = blank_page.html diff --git a/toolkit/components/payments/test/browser/browser_show_dialog.js b/toolkit/components/payments/test/browser/browser_show_dialog.js index 7360365a7ac9..8e3c07309f0d 100644 --- a/toolkit/components/payments/test/browser/browser_show_dialog.js +++ b/toolkit/components/payments/test/browser/browser_show_dialog.js @@ -161,48 +161,3 @@ add_task(async function test_show_completePayment() { await BrowserTestUtils.waitForCondition(() => win.closed, "dialog should be closed"); }); }); - -add_task(async function test_complete_called_dialog_closed() { - await BrowserTestUtils.withNewTab({ - gBrowser, - url: BLANK_PAGE_URL, - }, async browser => { - let {win, frame} = - await setupPaymentDialog(browser, { - methodData, - details, - merchantTaskFn: PTU.ContentTasks.createAndShowRequest, - } - ); - - info("clicking pay"); - spawnPaymentDialogTask(frame, PTU.DialogContentTasks.completePayment); - - // Add a handler to complete the payment above. - info("acknowledging the completion from the merchant page"); - await ContentTask.spawn(browser, {}, PTU.ContentTasks.addCompletionHandler); - - await BrowserTestUtils.waitForCondition(() => win.closed, "dialog should be closed"); - }); -}); - -add_task(async function test_complete_not_called_dialog_autoclosed() { - await BrowserTestUtils.withNewTab({ - gBrowser, - url: BLANK_PAGE_URL, - }, async browser => { - let {win, frame} = - await setupPaymentDialog(browser, { - methodData, - details, - merchantTaskFn: PTU.ContentTasks.createAndShowRequest, - } - ); - - info("clicking pay"); - spawnPaymentDialogTask(frame, PTU.DialogContentTasks.completePayment); - - // Not calling response.complete() should cause the dialog to timeout and autoclose. - await BrowserTestUtils.waitForCondition(() => win.closed, "dialog should be closed"); - }); -}); diff --git a/toolkit/components/payments/test/mochitest/test_payment_dialog.html b/toolkit/components/payments/test/mochitest/test_payment_dialog.html index 986b5b31f404..5101eb397020 100644 --- a/toolkit/components/payments/test/mochitest/test_payment_dialog.html +++ b/toolkit/components/payments/test/mochitest/test_payment_dialog.html @@ -40,7 +40,6 @@ let completionStates = [ ["processing", "Processing"], ["success", "Done"], ["fail", "Fail"], - ["unknown", "Unknown"], ]; /* test that: