michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: // Tests that console.group/groupEnd works as intended. michael@0: const TEST_URI = "data:text/html;charset=utf-8,Web Console test for bug 664131: Expand console object with group methods"; michael@0: michael@0: function test() { michael@0: Task.spawn(runner).then(finishTest); michael@0: michael@0: function* runner() { michael@0: let {tab} = yield loadTab(TEST_URI); michael@0: let hud = yield openConsole(tab); michael@0: let outputNode = hud.outputNode; michael@0: michael@0: hud.jsterm.clearOutput(); michael@0: michael@0: content.console.group("bug664131a"); michael@0: michael@0: yield waitForMessages({ michael@0: webconsole: hud, michael@0: messages: [{ michael@0: text: "bug664131a", michael@0: consoleGroup: 1, michael@0: }], michael@0: }); michael@0: michael@0: content.console.log("bug664131a-inside"); michael@0: michael@0: yield waitForMessages({ michael@0: webconsole: hud, michael@0: messages: [{ michael@0: text: "bug664131a-inside", michael@0: category: CATEGORY_WEBDEV, michael@0: severity: SEVERITY_LOG, michael@0: groupDepth: 1, michael@0: }], michael@0: }); michael@0: michael@0: content.console.groupEnd("bug664131a"); michael@0: content.console.log("bug664131-outside"); michael@0: michael@0: yield waitForMessages({ michael@0: webconsole: hud, michael@0: messages: [{ michael@0: text: "bug664131-outside", michael@0: category: CATEGORY_WEBDEV, michael@0: severity: SEVERITY_LOG, michael@0: groupDepth: 0, michael@0: }], michael@0: }); michael@0: michael@0: content.console.groupCollapsed("bug664131b"); michael@0: michael@0: yield waitForMessages({ michael@0: webconsole: hud, michael@0: messages: [{ michael@0: text: "bug664131b", michael@0: consoleGroup: 1, michael@0: }], michael@0: }); michael@0: michael@0: // Test that clearing the console removes the indentation. michael@0: hud.jsterm.clearOutput(); michael@0: content.console.log("bug664131-cleared"); michael@0: michael@0: yield waitForMessages({ michael@0: webconsole: hud, michael@0: messages: [{ michael@0: text: "bug664131-cleared", michael@0: category: CATEGORY_WEBDEV, michael@0: severity: SEVERITY_LOG, michael@0: groupDepth: 0, michael@0: }], michael@0: }); michael@0: } michael@0: }