browser/base/content/test/general/browser_bug422590.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 function test() {
     2   waitForExplicitFinish();
     3   // test the main (normal) browser window
     4   testCustomize(window, testChromeless);
     5 }
     7 function testChromeless() {
     8   // test a chromeless window
     9   var newWin = openDialog(getBrowserURL(), "_blank",
    10                           "chrome,dialog=no,location=yes,toolbar=no", "about:blank");
    11   ok(newWin, "got new window");
    13   whenDelayedStartupFinished(newWin, function () {
    14     // Check that the search bar is hidden
    15     var searchBar = newWin.BrowserSearch.searchBar;
    16     ok(searchBar, "got search bar");
    18     var searchBarBO = searchBar.boxObject;
    19     is(searchBarBO.width, 0, "search bar hidden");
    20     is(searchBarBO.height, 0, "search bar hidden");
    22     testCustomize(newWin, function () {
    23       newWin.close();
    24       finish();
    25     });
    26   });
    27 }
    29 function testCustomize(aWindow, aCallback) {
    30   var fileMenu = aWindow.document.getElementById("file-menu");
    31   ok(fileMenu, "got file menu");
    32   is(fileMenu.disabled, false, "file menu initially enabled");
    34   openToolbarCustomizationUI(function () {
    35     // Can't use the property, since the binding may have since been removed
    36     // if the element is hidden (see bug 422590)
    37     is(fileMenu.getAttribute("disabled"), "true",
    38        "file menu is disabled during toolbar customization");
    40     closeToolbarCustomizationUI(onClose, aWindow);
    41   }, aWindow);
    43   function onClose() {
    44     is(fileMenu.getAttribute("disabled"), "false",
    45        "file menu is enabled after toolbar customization");
    47     if (aCallback)
    48       aCallback();
    49   }
    50 }

mercurial