browser/devtools/webconsole/test/browser_webconsole_console_extras.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:0aa2075aa7b4
1 /* vim:set ts=2 sw=2 sts=2 et: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 // Test that window.console functions that are not implemented yet do not
7 // output anything in the web console and they do not throw any exceptions.
8 // See bug 614350.
9
10 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-extras.html";
11
12 function test() {
13 addTab(TEST_URI);
14 browser.addEventListener("load", function onLoad() {
15 browser.removeEventListener("load", onLoad, true);
16 openConsole(null, consoleOpened);
17 }, true);
18 }
19
20 function consoleOpened(hud) {
21 waitForMessages({
22 webconsole: hud,
23 messages: [{
24 text: "start",
25 category: CATEGORY_WEBDEV,
26 severity: SEVERITY_LOG,
27 },
28 {
29 text: "end",
30 category: CATEGORY_WEBDEV,
31 severity: SEVERITY_LOG,
32 }],
33 }).then(() => {
34 let nodes = hud.outputNode.querySelectorAll(".message");
35 is(nodes.length, 2, "only two messages are displayed");
36 finishTest();
37 });
38
39 let button = content.document.querySelector("button");
40 ok(button, "we have the button");
41 EventUtils.sendMouseEvent({ type: "click" }, button, content);
42 }

mercurial