diff options
Diffstat (limited to 'layout/xul/test')
-rw-r--r-- | layout/xul/test/browser_bug685470.js | 4 | ||||
-rw-r--r-- | layout/xul/test/browser_bug703210.js | 4 | ||||
-rw-r--r-- | layout/xul/test/browser_bug706743.js | 4 | ||||
-rw-r--r-- | layout/xul/test/chrome.toml | 1 | ||||
-rw-r--r-- | layout/xul/test/test_windowminmaxsize.xhtml | 62 | ||||
-rw-r--r-- | layout/xul/test/titledpanelwindow.xhtml | 5 |
6 files changed, 19 insertions, 61 deletions
diff --git a/layout/xul/test/browser_bug685470.js b/layout/xul/test/browser_bug685470.js index 46997b2e3b..faf013743c 100644 --- a/layout/xul/test/browser_bug685470.js +++ b/layout/xul/test/browser_bug685470.js @@ -6,9 +6,7 @@ add_task(async function () { "data:text/html," + html ); - await new Promise(resolve => { - SpecialPowers.pushPrefEnv({ set: [["ui.tooltipDelay", 0]] }, resolve); - }); + await SpecialPowers.pushPrefEnv({ set: [["ui.tooltip.delay_ms", 0]] }); await BrowserTestUtils.synthesizeMouseAtCenter( "#p1", diff --git a/layout/xul/test/browser_bug703210.js b/layout/xul/test/browser_bug703210.js index 5026875310..cf5a0850a3 100644 --- a/layout/xul/test/browser_bug703210.js +++ b/layout/xul/test/browser_bug703210.js @@ -10,9 +10,7 @@ add_task(async function () { let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url); let browser = gBrowser.selectedBrowser; - await new Promise(resolve => { - SpecialPowers.pushPrefEnv({ set: [["ui.tooltipDelay", 0]] }, resolve); - }); + await SpecialPowers.pushPrefEnv({ set: [["ui.tooltip.delay_ms", 0]] }); let popupShownPromise = BrowserTestUtils.waitForEvent( document, diff --git a/layout/xul/test/browser_bug706743.js b/layout/xul/test/browser_bug706743.js index c28721e831..af872644b9 100644 --- a/layout/xul/test/browser_bug706743.js +++ b/layout/xul/test/browser_bug706743.js @@ -8,9 +8,7 @@ add_task(async function () { let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url); let browser = gBrowser.selectedBrowser; - await new Promise(resolve => { - SpecialPowers.pushPrefEnv({ set: [["ui.tooltipDelay", 0]] }, resolve); - }); + await SpecialPowers.pushPrefEnv({ set: [["ui.tooltip.delay_ms", 0]] }); // Send a mousemove at a known position to start the test. await BrowserTestUtils.synthesizeMouse( diff --git a/layout/xul/test/chrome.toml b/layout/xul/test/chrome.toml index 6588db2ea4..f2262b3086 100644 --- a/layout/xul/test/chrome.toml +++ b/layout/xul/test/chrome.toml @@ -11,7 +11,6 @@ support-files = [ "windowminmaxsize8.xhtml", "windowminmaxsize9.xhtml", "windowminmaxsize10.xhtml", - "titledpanelwindow.xhtml", ] ["test_bug159346.xhtml"] diff --git a/layout/xul/test/test_windowminmaxsize.xhtml b/layout/xul/test/test_windowminmaxsize.xhtml index 187732dd3d..20f2109c80 100644 --- a/layout/xul/test/test_windowminmaxsize.xhtml +++ b/layout/xul/test/test_windowminmaxsize.xhtml @@ -125,59 +125,29 @@ function doPanelTest(panel) function nextPopupTest(panel) { if (++gTestId >= popupTests.length) { - // Next, check a panel that has a titlebar to ensure that it is accounted for - // properly in the size. - var titledPanelWindow = window.browsingContext.topChromeWindow.open("titledpanelwindow.xhtml", "_blank", "chrome,resizable=yes"); - SimpleTest.waitForFocus(titledPanelWindowOpened, titledPanelWindow); + SimpleTest.finish(); + return; } - else { - function setStyle(attr) { - if (attr in popupTests[gTestId]) - panel.style[attr] = popupTests[gTestId][attr] + "px"; - else - panel.style[attr] = ""; - } - setStyle("minWidth"); - setStyle("minHeight"); - setStyle("maxWidth"); - setStyle("maxHeight"); - - // Prevent event loop starvation as a result of popup events being - // synchronous. See bug 1131576. - SimpleTest.executeSoon(() => { - // Non-chrome shells require focus to open a popup. - SimpleTest.waitForFocus(() => { panel.openPopup() }); - }); + + function setStyle(attr) { + if (attr in popupTests[gTestId]) + panel.style[attr] = popupTests[gTestId][attr] + "px"; + else + panel.style[attr] = ""; } -} + setStyle("minWidth"); + setStyle("minHeight"); + setStyle("maxWidth"); + setStyle("maxHeight"); -function titledPanelWindowOpened(panelwindow) -{ - info("titledPanelWindowOpened"); - var panel = panelwindow.document.documentElement.firstChild; - panel.addEventListener("popupshown", () => doTitledPanelTest(panel)); - panel.addEventListener("popuphidden", () => done(panelwindow)); - // See above as for why. + // Prevent event loop starvation as a result of popup events being + // synchronous. See bug 1131576. SimpleTest.executeSoon(() => { - SimpleTest.waitForFocus(() => { panel.openPopup() }, panelwindow); + // Non-chrome shells require focus to open a popup. + SimpleTest.waitForFocus(() => { panel.openPopup() }); }); } -function doTitledPanelTest(panel) -{ - info("doTitledPanelTest"); - var rect = panel.getBoundingClientRect(); - is(rect.width, 120, "panel with titlebar width"); - is(rect.height, 140, "panel with titlebar height"); - panel.hidePopup(); -} - -function done(panelwindow) -{ - panelwindow.close(); - SimpleTest.finish(); -} - ]]> </script> diff --git a/layout/xul/test/titledpanelwindow.xhtml b/layout/xul/test/titledpanelwindow.xhtml deleted file mode 100644 index 4289f8deab..0000000000 --- a/layout/xul/test/titledpanelwindow.xhtml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml-stylesheet href='chrome://global/skin' type='text/css'?> -<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' align='start' pack='start' style='-moz-appearance: none; margin: 0; padding: 0; border: 0;'> - <panel noautohide='true' titlebar='normal' style="background: white; min-width: 120px; min-height: 140px"/> - <label value='Test'/> -</window> |