michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Check that the webconsole works if the network monitor is first opened, then michael@0: // the user switches to the webconsole. See bug 970914. michael@0: michael@0: function test() { michael@0: Task.spawn(runner).then(finishTest); michael@0: michael@0: function* runner() { michael@0: const {tab} = yield loadTab("data:text/html;charset=utf8,

hello"); michael@0: michael@0: const target = TargetFactory.forTab(tab); michael@0: const toolbox = yield gDevTools.showToolbox(target, "netmonitor"); michael@0: michael@0: const hud = yield openConsole(tab); michael@0: michael@0: hud.jsterm.execute("console.log('foobar bug970914')"); michael@0: michael@0: yield waitForMessages({ michael@0: webconsole: hud, michael@0: messages: [{ michael@0: name: "console.log", michael@0: text: "foobar bug970914", michael@0: category: CATEGORY_WEBDEV, michael@0: severity: SEVERITY_LOG, michael@0: }], michael@0: }); michael@0: michael@0: let text = hud.outputNode.textContent; michael@0: isnot(text.indexOf("foobar bug970914"), -1, "console.log message confirmed"); michael@0: ok(!/logging API|disabled by a script/i.test(text), michael@0: "no warning about disabled console API"); michael@0: } michael@0: } michael@0: