browser/devtools/webconsole/test/browser_webconsole_start_netmon_first.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 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 // Check that the webconsole works if the network monitor is first opened, then
     6 // the user switches to the webconsole. See bug 970914.
     8 function test() {
     9   Task.spawn(runner).then(finishTest);
    11   function* runner() {
    12     const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello");
    14     const target = TargetFactory.forTab(tab);
    15     const toolbox = yield gDevTools.showToolbox(target, "netmonitor");
    17     const hud = yield openConsole(tab);
    19     hud.jsterm.execute("console.log('foobar bug970914')");
    21     yield waitForMessages({
    22       webconsole: hud,
    23       messages: [{
    24         name: "console.log",
    25         text: "foobar bug970914",
    26         category: CATEGORY_WEBDEV,
    27         severity: SEVERITY_LOG,
    28       }],
    29     });
    31     let text = hud.outputNode.textContent;
    32     isnot(text.indexOf("foobar bug970914"), -1, "console.log message confirmed");
    33     ok(!/logging API|disabled by a script/i.test(text),
    34        "no warning about disabled console API");
    35   }
    36 }

mercurial