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 /* vim:set ts=2 sw=2 sts=2 et: */
2 /*
3 * Any copyright is dedicated to the Public Domain.
4 * http://creativecommons.org/publicdomain/zero/1.0/
5 */
7 // Tests that console.dir works as intended.
9 function test() {
10 addTab("data:text/html;charset=utf-8,Web Console test for bug 659907: Expand console " +
11 "object with a dir method");
12 browser.addEventListener("load", function onLoad(aEvent) {
13 browser.removeEventListener(aEvent.type, onLoad, true);
14 openConsole(null, consoleOpened);
15 }, true);
16 }
18 function consoleOpened(hud) {
19 hud.jsterm.execute("console.dir(document)");
20 hud.jsterm.once("variablesview-fetched", testConsoleDir.bind(null, hud));
21 }
23 function testConsoleDir(hud, ev, view) {
24 findVariableViewProperties(view, [
25 { name: "__proto__.__proto__.querySelectorAll", value: "querySelectorAll()" },
26 { name: "location", value: /Location \u2192 data:Web/ },
27 { name: "__proto__.write", value: "write()" },
28 ], { webconsole: hud }).then(finishTest);
29 }