Bug 979207 - add logging and better yielding to browser_968447_bookmarks_toolbar_items_in_panel.js, r=mikedeboer

--HG--
extra : rebase_source : cc2958a501ce7c8a23decfc79c51840133a29d4b
This commit is contained in:
Gijs Kruitbosch 2014-06-03 12:42:33 +01:00
parent 2a6c6a2d7a
commit 5dd71a583f

View File

@ -11,22 +11,42 @@ add_task(function() {
yield startCustomizing();
CustomizableUI.addWidgetToArea("personal-bookmarks", CustomizableUI.AREA_PANEL);
yield endCustomizing();
yield PanelUI.show();
let bookmarksToolbarPlaceholder = document.getElementById(buttonId);
ok(bookmarksToolbarPlaceholder.classList.contains("toolbarbutton-1"),
"Button should have toolbarbutton-1 class");
is(bookmarksToolbarPlaceholder.getAttribute("wrap"), "true",
"Button should have the 'wrap' attribute");
yield PanelUI.hide();
let newWin = yield openAndLoadWindow();
info("Waiting for panel to close");
let panelHiddenPromise = promisePanelHidden(window);
PanelUI.hide();
yield panelHiddenPromise;
info("Waiting for window to open");
let newWin = yield openAndLoadWindow({}, true);
info("Waiting for panel in new window to open");
yield newWin.PanelUI.show();
let newWinBookmarksToolbarPlaceholder = newWin.document.getElementById(buttonId);
ok(newWinBookmarksToolbarPlaceholder.classList.contains("toolbarbutton-1"),
"Button in new window should have toolbarbutton-1 class");
is(newWinBookmarksToolbarPlaceholder.getAttribute("wrap"), "true",
"Button in new window should have 'wrap' attribute");
yield newWin.PanelUI.hide();
info("Waiting for panel in new window to close");
panelHiddenPromise = promisePanelHidden(newWin);
newWin.PanelUI.hide();
yield panelHiddenPromise;
info("Waiting for new window to close");
yield promiseWindowClosed(newWin);
});
add_task(function asyncCleanUp() {
yield endCustomizing();
CustomizableUI.reset();
});