Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 }