browser/devtools/scratchpad/test/browser_scratchpad_open_error_console.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 /* 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);
    12     openScratchpad(runTests);
    13   }, true);
    15   content.location = "data:text/html;charset=utf8,test Scratchpad." +
    16                      "openErrorConsole()";
    17 }
    19 function runTests()
    20 {
    21   Services.obs.addObserver(function observer(aSubject) {
    22     Services.obs.removeObserver(observer, "web-console-created");
    23     aSubject.QueryInterface(Ci.nsISupportsString);
    25     let hud = HUDService.getBrowserConsole();
    26     ok(hud, "browser console is open");
    27     is(aSubject.data, hud.hudId, "notification hudId is correct");
    29     HUDService.toggleBrowserConsole().then(finish);
    30   }, "web-console-created", false);
    32   let hud = HUDService.getBrowserConsole();
    33   ok(!hud, "browser console is not open");
    34   info("wait for the browser console to open from Scratchpad");
    36   gScratchpadWindow.Scratchpad.openErrorConsole();
    37 }

mercurial