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