mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
63
devtools/client/commandline/test/browser_cmd_commands.js
Normal file
63
devtools/client/commandline/test/browser_cmd_commands.js
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test various GCLI commands
|
||||
|
||||
const TEST_URI = "data:text/html;charset=utf-8,gcli-commands";
|
||||
const HUDService = require("devtools/client/webconsole/hudservice");
|
||||
|
||||
// Use the old webconsole since pprint isn't working on new one (Bug 1304794)
|
||||
Services.prefs.setBoolPref("devtools.webconsole.new-frontend-enabled", false);
|
||||
registerCleanupFunction(function* () {
|
||||
Services.prefs.clearUserPref("devtools.webconsole.new-frontend-enabled");
|
||||
});
|
||||
|
||||
function test() {
|
||||
return Task.spawn(spawnTest).then(finish, helpers.handleError);
|
||||
}
|
||||
|
||||
function* spawnTest() {
|
||||
let options = yield helpers.openTab(TEST_URI);
|
||||
yield helpers.openToolbar(options);
|
||||
|
||||
let subjectPromise = helpers.observeOnce("web-console-created");
|
||||
|
||||
helpers.audit(options, [
|
||||
{
|
||||
setup: "console open",
|
||||
exec: { }
|
||||
}
|
||||
]);
|
||||
|
||||
let subject = yield subjectPromise;
|
||||
|
||||
subject.QueryInterface(Ci.nsISupportsString);
|
||||
let hud = HUDService.getHudReferenceById(subject.data);
|
||||
ok(hud, "console open");
|
||||
|
||||
let msg = yield hud.jsterm.execute("pprint(window)");
|
||||
|
||||
ok(msg, "output for pprint(window)");
|
||||
|
||||
yield helpers.audit(options, [
|
||||
{
|
||||
setup: "console clear",
|
||||
exec: { output: "" }
|
||||
}
|
||||
]);
|
||||
|
||||
let labels = hud.outputNode.querySelectorAll(".message");
|
||||
is(labels.length, 0, "no output in console");
|
||||
|
||||
yield helpers.audit(options, [
|
||||
{
|
||||
setup: "console close",
|
||||
exec: { output: "" }
|
||||
}
|
||||
]);
|
||||
|
||||
ok(!HUDService.getHudReferenceById(hud.hudId), "console closed");
|
||||
|
||||
yield helpers.closeToolbar(options);
|
||||
yield helpers.closeTab(options);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue