michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: // test the main (normal) browser window michael@0: testCustomize(window, testChromeless); michael@0: } michael@0: michael@0: function testChromeless() { michael@0: // test a chromeless window michael@0: var newWin = openDialog(getBrowserURL(), "_blank", michael@0: "chrome,dialog=no,location=yes,toolbar=no", "about:blank"); michael@0: ok(newWin, "got new window"); michael@0: michael@0: whenDelayedStartupFinished(newWin, function () { michael@0: // Check that the search bar is hidden michael@0: var searchBar = newWin.BrowserSearch.searchBar; michael@0: ok(searchBar, "got search bar"); michael@0: michael@0: var searchBarBO = searchBar.boxObject; michael@0: is(searchBarBO.width, 0, "search bar hidden"); michael@0: is(searchBarBO.height, 0, "search bar hidden"); michael@0: michael@0: testCustomize(newWin, function () { michael@0: newWin.close(); michael@0: finish(); michael@0: }); michael@0: }); michael@0: } michael@0: michael@0: function testCustomize(aWindow, aCallback) { michael@0: var fileMenu = aWindow.document.getElementById("file-menu"); michael@0: ok(fileMenu, "got file menu"); michael@0: is(fileMenu.disabled, false, "file menu initially enabled"); michael@0: michael@0: openToolbarCustomizationUI(function () { michael@0: // Can't use the property, since the binding may have since been removed michael@0: // if the element is hidden (see bug 422590) michael@0: is(fileMenu.getAttribute("disabled"), "true", michael@0: "file menu is disabled during toolbar customization"); michael@0: michael@0: closeToolbarCustomizationUI(onClose, aWindow); michael@0: }, aWindow); michael@0: michael@0: function onClose() { michael@0: is(fileMenu.getAttribute("disabled"), "false", michael@0: "file menu is enabled after toolbar customization"); michael@0: michael@0: if (aCallback) michael@0: aCallback(); michael@0: } michael@0: }