Bug 1403152 - fix test browser_html_tooltip_xul-wrapper.js for small viewports;r=me

MozReview-Commit-ID: A1W1LCDjupO

--HG--
extra : rebase_source : 30fceb0a393c767a839a554135143c1f235c0121
This commit is contained in:
Julian Descottes 2017-09-26 15:04:59 +02:00
parent fa921ed2a3
commit 4c5032bb5b

View File

@ -26,10 +26,19 @@ add_task(function* () {
let [, win, doc] = yield createHost("bottom", TEST_URI);
info("Resizing window to have some space below the window.");
info("Resize and move the window to have space below.");
let originalWidth = win.top.outerWidth;
let originalHeight = win.top.outerHeight;
win.top.resizeBy(0, -100);
win.top.resizeBy(-100, -200);
let originalTop = win.top.screenTop;
let originalLeft = win.top.screenLeft;
win.top.moveTo(100, 100);
registerCleanupFunction(() => {
info("Restore original window dimensions and position.");
win.top.resizeTo(originalWidth, originalHeight);
win.top.moveTo(originalTop, originalLeft);
});
info("Create HTML tooltip");
let tooltip = new HTMLTooltip(doc, {useXulWrapper: true});
@ -55,9 +64,6 @@ add_task(function* () {
is(tooltip.isVisible(), false, "Tooltip is not visible");
tooltip.destroy();
info("Restore original window dimensions.");
win.top.resizeTo(originalWidth, originalHeight);
});
function checkTooltip(tooltip, position, height) {