browser/devtools/webconsole/test/browser_webconsole_bug_621644_jsterm_dollar.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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 }

mercurial