gecko/browser/devtools/webconsole/test/browser_jsterm_inspect.js
Mihai Sucan a2344897e5 Bug 843004 - Part 4: Tests for pretty output of objects; r=nfitzgerald
--HG--
rename : browser/devtools/webconsole/test/browser_webconsole_bug_598357_jsterm_output.js => browser/devtools/webconsole/test/browser_webconsole_output_01.js
2013-12-19 23:07:54 +02:00

36 lines
933 B
JavaScript

/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
// Check that the inspect() jsterm helper function works.
function test()
{
const TEST_URI = "data:text/html;charset=utf8,<p>hello bug 869981";
addTab(TEST_URI);
browser.addEventListener("load", function onLoad() {
browser.removeEventListener("load", onLoad, true);
openConsole(null, consoleOpened);
}, true);
function consoleOpened(hud)
{
content.wrappedJSObject.testProp = "testValue";
hud.jsterm.once("variablesview-fetched", onObjFetch);
hud.jsterm.execute("inspect(window)");
}
function onObjFetch(aEvent, aVar)
{
ok(aVar._variablesView, "variables view object");
findVariableViewProperties(aVar, [
{ name: "testProp", value: "testValue" },
{ name: "document", value: /HTMLDocument \u2192 data:/ },
], { webconsole: hud }).then(finishTest);
}
}