michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: // Make sure that JS eval result are properly formatted as strings. michael@0: michael@0: const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-result-format-as-string.html"; michael@0: michael@0: function test() michael@0: { michael@0: waitForExplicitFinish(); michael@0: michael@0: addTab(TEST_URI); michael@0: michael@0: gBrowser.selectedBrowser.addEventListener("load", function onLoad() { michael@0: gBrowser.selectedBrowser.removeEventListener("load", onLoad, true); michael@0: openConsole(null, performTest); michael@0: }, true); michael@0: } michael@0: michael@0: function performTest(hud) michael@0: { michael@0: hud.jsterm.clearOutput(true); michael@0: michael@0: hud.jsterm.execute("document.querySelector('p')", (msg) => { michael@0: is(hud.outputNode.textContent.indexOf("bug772506_content"), -1, michael@0: "no content element found"); michael@0: ok(!hud.outputNode.querySelector("#foobar"), "no #foobar element found"); michael@0: michael@0: ok(msg, "eval output node found"); michael@0: is(msg.textContent.indexOf("
"), -1, michael@0: "
string is not displayed"); michael@0: isnot(msg.textContent.indexOf("

"), -1, michael@0: "

string is displayed"); michael@0: michael@0: EventUtils.synthesizeMouseAtCenter(msg, {type: "mousemove"}); michael@0: ok(!gBrowser._bug772506, "no content variable"); michael@0: michael@0: finishTest(); michael@0: }); michael@0: }