Backed out changeset 02b822f97e35 (bug 1670643) for causing failures on browser_modal_print. CLOSED TREE

This commit is contained in:
smolnar 2020-10-15 14:45:06 +03:00
Родитель ac9ded3781
Коммит ac8b15e7f7
3 изменённых файлов: 1 добавлений и 31 удалений

Просмотреть файл

@ -315,18 +315,6 @@ var PrintEventHandler = {
initialBrowsingContextGroupId: sourceBrowsingContext.group.id,
skipLoad: true,
});
printPreviewBrowser.addEventListener("DOMWindowClose", function(e) {
// Ignore close events from printing, see the code creating browsers in
// printUtils.js and nsDocumentViewer::OnDonePrinting.
//
// When we print with the new print UI we don't bother creating a new
// <browser> element, so the close event gets dispatched to us.
//
// Ignoring it is harmless (and doesn't cause correctness issues, because
// the preview document can't run script anyways).
e.preventDefault();
e.stopPropagation();
});
printPreviewBrowser.classList.add("printPreviewBrowser");
printPreviewBrowser.setAttribute("flex", "1");
printPreviewBrowser.setAttribute("printpreview", "true");

Просмотреть файл

@ -171,19 +171,3 @@ add_task(async function testEnterPrintsFromOrientation() {
is(helper.doc.activeElement, portrait, "Portrait is focused");
}, "print_orientation_focused.pdf");
});
add_task(async function testPrintOnNewWindowDoesntClose() {
info("Test that printing doesn't close a window with a single tab");
let win = await BrowserTestUtils.openNewBrowserWindow();
let browser = win.gBrowser.selectedBrowser;
await BrowserTestUtils.loadURI(browser, PrintHelper.defaultTestPageUrl);
await BrowserTestUtils.browserLoaded(browser);
let helper = new PrintHelper(browser);
await helper.startPrint();
let file = helper.mockFilePicker("print_new_window_close.pdf");
await helper.assertPrintToFile(file, () => {
EventUtils.sendKey("return", helper.win);
});
ok(!win.closed, "Shouldn't be closed");
await BrowserTestUtils.closeWindow(win);
});

Просмотреть файл

@ -60,9 +60,7 @@ class PrintHelper {
}
async startPrint() {
this.sourceBrowser.ownerGlobal.document
.getElementById("cmd_print")
.doCommand();
document.getElementById("cmd_print").doCommand();
let dialog = await TestUtils.waitForCondition(
() => this.dialog,
"Wait for dialog"