 +    if (typeof aBody == "string") {
 +      aBody = aDocument.createTextNode(aBody);
 +    }
-
+ 
      bodyNode.appendChild(aBody);
-
-     let repeatNode = aDocument.createElementNS(XUL_NS, "xul:label");
-     repeatNode.setAttribute("value", "1");
-     repeatNode.classList.add("webconsole-msg-repeat");
-
-     // Create the timestamp.
-@@ -6638,8 +6695,384 @@ try {
-   // *any* of this fails
-   var HUDService = new HUD_SERVICE();
- }
- catch (ex) {
-   Cu.reportError("HUDService failed initialization.\n" + ex);
+ 
+@@ -6661,3 +6718,379 @@
    // TODO: kill anything that may have started up
    // see bug 568665
  }

  *
  * Alternatively, the contents of this file may be used under the terms of
  * either the GNU General Public License Version 2 or later (the "GPL"), or
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
@@ -2676,19 +2677,35 @@ HUD_SERVICE.prototype =
    *        Console object used within the JSTerm instance to report errors
    *        and log data (by calling console.error(), console.log(), etc).
    */
   initializeJSTerm: function HS_initializeJSTerm(aContext, aParentNode, aConsole)
   {
     // create Initial JS Workspace:
     var context = Cu.getWeakReference(aContext);

+    let usegcli = false;
+    try {
+      usegcli = Services.prefs.getBoolPref("devtools.gcli.enable");

+}
+
+function testCallCommands() {
+  let console = browser.contentWindow.wrappedJSObject.console;
+
+  let hudId = HUDService.displaysIndex()[0];
+  let hud = HUDService.hudReferences[hudId];
+  ok(hud, "There is a console");
+
+  let hudBox = HUDService.getHeadsUpDisplay(hudId);
+  ok(hudBox, "We have a console display");
+
+  let gcliterm = hud.gcliterm;
+  ok(gcliterm, "We have a GCLI term");
+
+  let outputNode = hudBox.querySelector(".hud-output-node");
+
+  // Test auto-completion
+  gcliterm._setInputValue("ec");
+  let event = browser.createEvent("KeyboardEvent");
+  event.initKeyEvent("keyup", true, true, null, false,
+                     false, false, false, 80, 0);
+  gcliterm.inputNode.dispatchEvent(event);
+  is(gcliterm.completeNode.value, "  ho", "Completion for \"ec\"");
+}
+
+function testRemoveCommands() {
