browser/devtools/webconsole/test/browser_webconsole_start_netmon_first.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:8a2da4c8c84f
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/. */
4
5 // Check that the webconsole works if the network monitor is first opened, then
6 // the user switches to the webconsole. See bug 970914.
7
8 function test() {
9 Task.spawn(runner).then(finishTest);
10
11 function* runner() {
12 const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello");
13
14 const target = TargetFactory.forTab(tab);
15 const toolbox = yield gDevTools.showToolbox(target, "netmonitor");
16
17 const hud = yield openConsole(tab);
18
19 hud.jsterm.execute("console.log('foobar bug970914')");
20
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 });
30
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 }
37

mercurial