Bug 979207 - add some logging to see if the popup is getting closed while opening, r=mconley

This commit is contained in:
Gijs Kruitbosch 2014-06-16 14:33:53 +01:00
parent 48ce07a8fe
commit cbb0d04a34

View File

@ -29,6 +29,12 @@ add_task(function() {
let newWin = yield openAndLoadWindow({}, true);
info("Waiting for panel in new window to open");
let hideTrace = function() {
info(new Error().stack);
info("Panel was hidden.");
};
newWin.PanelUI.panel.addEventListener("popuphidden", hideTrace);
yield newWin.PanelUI.show();
let newWinBookmarksToolbarPlaceholder = newWin.document.getElementById(buttonId);
ok(newWinBookmarksToolbarPlaceholder.classList.contains("toolbarbutton-1"),
@ -36,6 +42,7 @@ add_task(function() {
is(newWinBookmarksToolbarPlaceholder.getAttribute("wrap"), "true",
"Button in new window should have 'wrap' attribute");
newWin.PanelUI.panel.removeEventListener("popuphidden", hideTrace);
//XXXgijs on Linux, we're sometimes seeing the panel being hidden early
// in the newly created window, probably because something else steals focus.
if (newWin.PanelUI.panel.state != "closed") {