browser/devtools/scratchpad/test/browser_scratchpad_initialization.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 /* vim: set ts=2 et sw=2 tw=80: */
     2 /* Any copyright is dedicated to the Public Domain.
     3    http://creativecommons.org/publicdomain/zero/1.0/ */
     5 function test()
     6 {
     7   waitForExplicitFinish();
     9   gBrowser.selectedTab = gBrowser.addTab();
    10   gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
    11     gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
    13     ok(window.Scratchpad, "Scratchpad variable exists");
    15     openScratchpad(runTests);
    16   }, true);
    18   content.location = "data:text/html,initialization test for Scratchpad";
    19 }
    21 function runTests()
    22 {
    23   let sp = gScratchpadWindow.Scratchpad;
    24   ok(sp, "Scratchpad object exists in new window");
    25   is(typeof sp.run, "function", "Scratchpad.run() exists");
    26   is(typeof sp.inspect, "function", "Scratchpad.inspect() exists");
    27   is(typeof sp.display, "function", "Scratchpad.display() exists");
    29   let environmentMenu = gScratchpadWindow.document.
    30                           getElementById("sp-environment-menu");
    31   ok(environmentMenu, "Environment menu element exists");
    32   ok(environmentMenu.hasAttribute("hidden"),
    33      "Environment menu is not visible");
    35   let errorConsoleCommand = gScratchpadWindow.document.
    36                             getElementById("sp-cmd-errorConsole");
    37   ok(errorConsoleCommand, "Error console command element exists");
    38   is(errorConsoleCommand.getAttribute("disabled"), "true",
    39      "Error console command is disabled");
    41   let chromeContextCommand = gScratchpadWindow.document.
    42                             getElementById("sp-cmd-browserContext");
    43   ok(chromeContextCommand, "Chrome context command element exists");
    44   is(chromeContextCommand.getAttribute("disabled"), "true",
    45      "Chrome context command is disabled");
    47   finish();
    48 }

mercurial