<commit_before>
registerCleanupFunction(function() {
  Services.prefs.clearUserPref("devtools.gcli.enable");

  obj = undefined;
  define = undefined;
  console = undefined;
  Node = undefined;
});

function test() {
  Services.prefs.setBoolPref("devtools.gcli.enable", true);
  addTab("http://example.com/browser/browser/devtools/webconsole/test/browser/test-console.html");
  browser.addEventListener("DOMContentLoaded", onLoad, false);
}

function onLoad() {
  browser.removeEventListener("DOMContentLoaded", onLoad, false);

  try {
    openConsole();
    require("gclitest/index");
  }
  catch (ex) {
    console.error('Test Failure', ex);
  }
  finally {
    closeConsole();
    finishTest();
  }
}<commit_msg>Bug 690822 (webtest): Use require correctly Also, use the shorter finish() function.<commit_after>
registerCleanupFunction(function() {
  Services.prefs.clearUserPref("devtools.gcli.enable");

  obj = undefined;
  define = undefined;
  console = undefined;
  Node = undefined;
});

function test() {
  Services.prefs.setBoolPref("devtools.gcli.enable", true);
  addTab("http://example.com/browser/browser/devtools/webconsole/test/browser/test-console.html");
  browser.addEventListener("DOMContentLoaded", onLoad, false);
}

function onLoad() {
  browser.removeEventListener("DOMContentLoaded", onLoad, false);

  try {
    openConsole();
    define.globalDomain.require("gclitest/index");
  }
  catch (ex) {
    console.error('Test Failure', ex);
  }
  finally {
    closeConsole();
    finish();
  }
}
{'fraction_non_alphanumeric': 0.14944042132982224, 'fraction_numerical': 0.003949967083607637, 'mean_word_length': 4.608856088560886, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2334146', 'n_tokens_mistral': 480, 'n_tokens_neox': 469, 'n_words': 81}