Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* vim:set ts=2 sw=2 sts=2 et: */ |
michael@0 | 2 | /* |
michael@0 | 3 | * Any copyright is dedicated to the Public Domain. |
michael@0 | 4 | * http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 5 | * |
michael@0 | 6 | * Contributor(s): |
michael@0 | 7 | * Mihai Sucan <mihai.sucan@gmail.com> |
michael@0 | 8 | */ |
michael@0 | 9 | |
michael@0 | 10 | const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug-621644-jsterm-dollar.html"; |
michael@0 | 11 | |
michael@0 | 12 | function test$(HUD) { |
michael@0 | 13 | HUD.jsterm.clearOutput(); |
michael@0 | 14 | |
michael@0 | 15 | HUD.jsterm.execute("$(document.body)", (msg) => { |
michael@0 | 16 | ok(msg.textContent.indexOf("<p>") > -1, |
michael@0 | 17 | "jsterm output is correct for $()"); |
michael@0 | 18 | |
michael@0 | 19 | test$$(HUD); |
michael@0 | 20 | }); |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | function test$$(HUD) { |
michael@0 | 24 | HUD.jsterm.clearOutput(); |
michael@0 | 25 | |
michael@0 | 26 | HUD.jsterm.setInputValue(); |
michael@0 | 27 | HUD.jsterm.execute("$$(document)", (msg) => { |
michael@0 | 28 | ok(msg.textContent.indexOf("621644") > -1, |
michael@0 | 29 | "jsterm output is correct for $$()"); |
michael@0 | 30 | finishTest(); |
michael@0 | 31 | }); |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function test() { |
michael@0 | 35 | addTab(TEST_URI); |
michael@0 | 36 | browser.addEventListener("load", function onLoad() { |
michael@0 | 37 | browser.removeEventListener("load", onLoad, true); |
michael@0 | 38 | openConsole(null, test$); |
michael@0 | 39 | }, true); |
michael@0 | 40 | } |