 + * http://opensource.org/licenses/BSD-3-Clause
 + */
 +
-+define('gclitest/index', ['require', 'exports', 'module' , 'test/examiner', 'gclitest/testTokenize', 'gclitest/testSplit', 'gclitest/testCli', 'gclitest/testHistory', 'gclitest/testRequire'], function(require, exports, module) {
++define('gclitest/index', ['require', 'exports', 'module' , 'gcli/index', 'test/examiner', 'gclitest/testTokenize', 'gclitest/testSplit', 'gclitest/testCli', 'gclitest/testHistory', 'gclitest/testRequire'], function(require, exports, module) {
++
++  // We need to make sure GCLI is initialized before we begin testing it
++  require('gcli/index');
 +
 +  var examiner = require('test/examiner');
 +

+
+});
+
+registerCleanupFunction(function() {
+  Services.prefs.clearUserPref("devtools.gcli.enable");
+
+  obj = undefined;
+  define = undefined;
+  console = undefined;

+
+function onLoad() {
+  browser.removeEventListener("DOMContentLoaded", onLoad, false);
+  var failed = false;
+
+  try {
+    openConsole();
+    define.globalDomain.require("gclitest/index");
+  }
+  catch (ex) {
+    failed = ex;
+    console.error('Test Failure', ex);
+  }
+  finally {
+    closeConsole();
+    finish();
+  }
+
+  if (failed) {
+    throw failed;
+  }
+}
