browser/devtools/webconsole/test/browser_webconsole_bug_664131_console_group.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 sw=2 sts=2 et: */
     2 /*
     3  * Any copyright is dedicated to the Public Domain.
     4  * http://creativecommons.org/publicdomain/zero/1.0/
     5  */
     7 // Tests that console.group/groupEnd works as intended.
     8 const TEST_URI = "data:text/html;charset=utf-8,Web Console test for bug 664131: Expand console object with group methods";
    10 function test() {
    11   Task.spawn(runner).then(finishTest);
    13   function* runner() {
    14     let {tab} = yield loadTab(TEST_URI);
    15     let hud = yield openConsole(tab);
    16     let outputNode = hud.outputNode;
    18     hud.jsterm.clearOutput();
    20     content.console.group("bug664131a");
    22     yield waitForMessages({
    23       webconsole: hud,
    24       messages: [{
    25         text: "bug664131a",
    26         consoleGroup: 1,
    27       }],
    28     });
    30     content.console.log("bug664131a-inside");
    32     yield waitForMessages({
    33       webconsole: hud,
    34       messages: [{
    35         text: "bug664131a-inside",
    36         category: CATEGORY_WEBDEV,
    37         severity: SEVERITY_LOG,
    38         groupDepth: 1,
    39       }],
    40     });
    42     content.console.groupEnd("bug664131a");
    43     content.console.log("bug664131-outside");
    45     yield waitForMessages({
    46       webconsole: hud,
    47       messages: [{
    48         text: "bug664131-outside",
    49         category: CATEGORY_WEBDEV,
    50         severity: SEVERITY_LOG,
    51         groupDepth: 0,
    52       }],
    53     });
    55     content.console.groupCollapsed("bug664131b");
    57     yield waitForMessages({
    58       webconsole: hud,
    59       messages: [{
    60         text: "bug664131b",
    61         consoleGroup: 1,
    62       }],
    63     });
    65     // Test that clearing the console removes the indentation.
    66     hud.jsterm.clearOutput();
    67     content.console.log("bug664131-cleared");
    69     yield waitForMessages({
    70       webconsole: hud,
    71       messages: [{
    72         text: "bug664131-cleared",
    73         category: CATEGORY_WEBDEV,
    74         severity: SEVERITY_LOG,
    75         groupDepth: 0,
    76       }],
    77     });
    78   }
    79 }

mercurial