зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1382388 - add test for manual abort. r=MattN
MozReview-Commit-ID: Lu7VWVg3qN8 --HG-- extra : rebase_source : 5c03b0c25a0648f6a4a498b0ac94dcfb2d4b6750
This commit is contained in:
Родитель
cec11e294b
Коммит
16aa04e2a4
|
@ -29,3 +29,25 @@ add_task(async function test_show_abort_dialog() {
|
|||
ok(win.closed, "dialog should be closed");
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_show_manualAbort_dialog() {
|
||||
await BrowserTestUtils.withNewTab({
|
||||
gBrowser,
|
||||
url: BLANK_PAGE_URL,
|
||||
}, async browser => {
|
||||
// start by creating a PaymentRequest, and show it
|
||||
await ContentTask.spawn(browser, {methodData, details}, ContentTasks.createAndShowRequest);
|
||||
|
||||
// get a reference to the UI dialog and the requestId
|
||||
let win = await getDialogWindow();
|
||||
let requestId = paymentUISrv.requestIdForWindow(win);
|
||||
ok(requestId, "requestId should be defined");
|
||||
ok(!win.closed, "dialog should not be closed");
|
||||
|
||||
// abort the payment request manually
|
||||
let frameLoader = win.document.getElementById("paymentRequestFrame").frameLoader;
|
||||
await ContentTask.spawn(frameLoader, null, ContentTasks.manuallyClickCancel);
|
||||
|
||||
ok(win.closed, "dialog should be closed");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -34,6 +34,10 @@ let ContentTasks = {
|
|||
content.rq = rq; // assign it so we can retrieve it later
|
||||
rq.show();
|
||||
},
|
||||
|
||||
manuallyClickCancel: async () => {
|
||||
content.document.getElementById("cancel").click();
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче