1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_621644_jsterm_dollar.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +/* vim:set ts=2 sw=2 sts=2 et: */ 1.5 +/* 1.6 + * Any copyright is dedicated to the Public Domain. 1.7 + * http://creativecommons.org/publicdomain/zero/1.0/ 1.8 + * 1.9 + * Contributor(s): 1.10 + * Mihai Sucan <mihai.sucan@gmail.com> 1.11 + */ 1.12 + 1.13 +const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug-621644-jsterm-dollar.html"; 1.14 + 1.15 +function test$(HUD) { 1.16 + HUD.jsterm.clearOutput(); 1.17 + 1.18 + HUD.jsterm.execute("$(document.body)", (msg) => { 1.19 + ok(msg.textContent.indexOf("<p>") > -1, 1.20 + "jsterm output is correct for $()"); 1.21 + 1.22 + test$$(HUD); 1.23 + }); 1.24 +} 1.25 + 1.26 +function test$$(HUD) { 1.27 + HUD.jsterm.clearOutput(); 1.28 + 1.29 + HUD.jsterm.setInputValue(); 1.30 + HUD.jsterm.execute("$$(document)", (msg) => { 1.31 + ok(msg.textContent.indexOf("621644") > -1, 1.32 + "jsterm output is correct for $$()"); 1.33 + finishTest(); 1.34 + }); 1.35 +} 1.36 + 1.37 +function test() { 1.38 + addTab(TEST_URI); 1.39 + browser.addEventListener("load", function onLoad() { 1.40 + browser.removeEventListener("load", onLoad, true); 1.41 + openConsole(null, test$); 1.42 + }, true); 1.43 +}