Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | function test() { |
michael@0 | 2 | waitForExplicitFinish(); |
michael@0 | 3 | // test the main (normal) browser window |
michael@0 | 4 | testCustomize(window, testChromeless); |
michael@0 | 5 | } |
michael@0 | 6 | |
michael@0 | 7 | function testChromeless() { |
michael@0 | 8 | // test a chromeless window |
michael@0 | 9 | var newWin = openDialog(getBrowserURL(), "_blank", |
michael@0 | 10 | "chrome,dialog=no,location=yes,toolbar=no", "about:blank"); |
michael@0 | 11 | ok(newWin, "got new window"); |
michael@0 | 12 | |
michael@0 | 13 | whenDelayedStartupFinished(newWin, function () { |
michael@0 | 14 | // Check that the search bar is hidden |
michael@0 | 15 | var searchBar = newWin.BrowserSearch.searchBar; |
michael@0 | 16 | ok(searchBar, "got search bar"); |
michael@0 | 17 | |
michael@0 | 18 | var searchBarBO = searchBar.boxObject; |
michael@0 | 19 | is(searchBarBO.width, 0, "search bar hidden"); |
michael@0 | 20 | is(searchBarBO.height, 0, "search bar hidden"); |
michael@0 | 21 | |
michael@0 | 22 | testCustomize(newWin, function () { |
michael@0 | 23 | newWin.close(); |
michael@0 | 24 | finish(); |
michael@0 | 25 | }); |
michael@0 | 26 | }); |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | function testCustomize(aWindow, aCallback) { |
michael@0 | 30 | var fileMenu = aWindow.document.getElementById("file-menu"); |
michael@0 | 31 | ok(fileMenu, "got file menu"); |
michael@0 | 32 | is(fileMenu.disabled, false, "file menu initially enabled"); |
michael@0 | 33 | |
michael@0 | 34 | openToolbarCustomizationUI(function () { |
michael@0 | 35 | // Can't use the property, since the binding may have since been removed |
michael@0 | 36 | // if the element is hidden (see bug 422590) |
michael@0 | 37 | is(fileMenu.getAttribute("disabled"), "true", |
michael@0 | 38 | "file menu is disabled during toolbar customization"); |
michael@0 | 39 | |
michael@0 | 40 | closeToolbarCustomizationUI(onClose, aWindow); |
michael@0 | 41 | }, aWindow); |
michael@0 | 42 | |
michael@0 | 43 | function onClose() { |
michael@0 | 44 | is(fileMenu.getAttribute("disabled"), "false", |
michael@0 | 45 | "file menu is enabled after toolbar customization"); |
michael@0 | 46 | |
michael@0 | 47 | if (aCallback) |
michael@0 | 48 | aCallback(); |
michael@0 | 49 | } |
michael@0 | 50 | } |