Bug 1435871 - Back out changeset 3f6664786e85 (Bug 1470584) since it's for a windowed dialog. r=jaws

Differential Revision: https://phabricator.services.mozilla.com/D8272

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Noorenberghe 2018-10-20 03:38:53 +00:00
parent 9ae59445f8
commit 33750c5b1f
3 changed files with 0 additions and 66 deletions

View File

@ -32,7 +32,6 @@ function PaymentUIService() {
prefix: "Payment UI Service",
});
});
Services.wm.addListener(this);
this.log.debug("constructor");
}
@ -42,19 +41,6 @@ PaymentUIService.prototype = {
DIALOG_URL: "chrome://payments/content/paymentDialogWrapper.xul",
REQUEST_ID_PREFIX: "paymentRequest-",
// nsIWindowMediatorListener implementation:
onOpenWindow(aWindow) {},
onCloseWindow(aWindow) {
let domWindow = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
let requestId = this.requestIdForWindow(domWindow);
if (!requestId || !paymentSrv.getPaymentRequestById(requestId)) {
return;
}
this.log.debug(`onCloseWindow, close of window for active requestId: ${requestId}`);
this.rejectPaymentForClosedDialog(requestId);
},
// nsIPaymentUIService implementation:
showPayment(requestId) {
@ -81,20 +67,6 @@ PaymentUIService.prototype = {
paymentSrv.respondPayment(abortResponse);
},
rejectPaymentForClosedDialog(requestId) {
this.log.debug("rejectPaymentForClosedDialog:", requestId);
const rejectResponse = Cc["@mozilla.org/dom/payments/payment-show-action-response;1"]
.createInstance(Ci.nsIPaymentShowActionResponse);
rejectResponse.init(requestId,
Ci.nsIPaymentActionResponse.PAYMENT_REJECTED,
"", // payment method
null, // payment method data
"", // payer name
"", // payer email
"");// payer phone
paymentSrv.respondPayment(rejectResponse);
},
completePayment(requestId) {
// completeStatus should be one of "timeout", "success", "fail", ""
let {completeStatus} = paymentSrv.getPaymentRequestById(requestId);

View File

@ -122,19 +122,6 @@ var PaymentTestUtils = {
handle.destruct();
},
/**
* Add a rejection handler for the `showPromise` created by createAndShowRequest
* and stash details of any eventual exception or response in `rqResult`
*/
catchShowPromiseRejection: () => {
content.rqResult = {};
content.showPromise.then(res => content.rqResult.response = res)
.catch(ex => content.rqResult.showException = {
name: ex.name,
message: ex.message,
});
},
},
DialogContentTasks: {

View File

@ -143,31 +143,6 @@ add_task(async function test_show_completePayment2() {
});
});
add_task(async function test_show_closeReject_dialog() {
await BrowserTestUtils.withNewTab({
gBrowser,
url: BLANK_PAGE_URL,
}, async browser => {
let {win} =
await setupPaymentDialog(browser, {
methodData,
details,
merchantTaskFn: PTU.ContentTasks.createAndShowRequest,
}
);
await ContentTask.spawn(browser, null, PTU.ContentTasks.catchShowPromiseRejection);
info("Closing the dialog to reject the payment request");
BrowserTestUtils.closeWindow(win);
await BrowserTestUtils.waitForCondition(() => win.closed, "dialog should be closed");
let result = await ContentTask.spawn(browser, null, async () => content.rqResult);
ok(result.showException, "Expected promise rejection from the rq.show() promise");
ok(!result.response,
"rq.show() shouldn't resolve to a response");
});
});
add_task(async function test_localized() {
await BrowserTestUtils.withNewTab({
gBrowser,