diff -r 000000000000 -r 6474c204b198 browser/devtools/webconsole/test/browser_jsterm_inspect.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/devtools/webconsole/test/browser_jsterm_inspect.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,35 @@ +/* + * 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,
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); + } +}