Bug 979207 - add logging and better yielding to browser_968447_bookmarks_toolbar_items_in_panel.js, r=mikedeboer
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 03 Jun 2014 12:42:33 +0100
changeset 206876 2fbb4b93bce197cc81dc3d02c8289392cc47ba76
parent 206875 f54eeeffe2a2317e81bbf39e5a844e6a29255d49
child 206877 c9db5a1356bca1660b9a7e4da5d01ee48ec0dc65
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs979207
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 979207 - add logging and better yielding to browser_968447_bookmarks_toolbar_items_in_panel.js, r=mikedeboer
browser/components/customizableui/test/browser_968447_bookmarks_toolbar_items_in_panel.js
--- a/browser/components/customizableui/test/browser_968447_bookmarks_toolbar_items_in_panel.js
+++ b/browser/components/customizableui/test/browser_968447_bookmarks_toolbar_items_in_panel.js
@@ -6,27 +6,47 @@
 
 // Bug 968447 - The Bookmarks Toolbar Items doesn't appear as a
 // normal menu panel button in new windows.
 add_task(function() {
   const buttonId = "bookmarks-toolbar-placeholder";
   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();
 });
+