browser/devtools/webconsole/test/browser_webconsole_bug_659907_console_dir.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 }

mercurial