|
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 * |
|
6 * Contributor(s): |
|
7 * Mihai Sucan <mihai.sucan@gmail.com> |
|
8 */ |
|
9 |
|
10 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug-621644-jsterm-dollar.html"; |
|
11 |
|
12 function test$(HUD) { |
|
13 HUD.jsterm.clearOutput(); |
|
14 |
|
15 HUD.jsterm.execute("$(document.body)", (msg) => { |
|
16 ok(msg.textContent.indexOf("<p>") > -1, |
|
17 "jsterm output is correct for $()"); |
|
18 |
|
19 test$$(HUD); |
|
20 }); |
|
21 } |
|
22 |
|
23 function test$$(HUD) { |
|
24 HUD.jsterm.clearOutput(); |
|
25 |
|
26 HUD.jsterm.setInputValue(); |
|
27 HUD.jsterm.execute("$$(document)", (msg) => { |
|
28 ok(msg.textContent.indexOf("621644") > -1, |
|
29 "jsterm output is correct for $$()"); |
|
30 finishTest(); |
|
31 }); |
|
32 } |
|
33 |
|
34 function test() { |
|
35 addTab(TEST_URI); |
|
36 browser.addEventListener("load", function onLoad() { |
|
37 browser.removeEventListener("load", onLoad, true); |
|
38 openConsole(null, test$); |
|
39 }, true); |
|
40 } |