<commit_before>var wnd = null;
var doc = null;
// A flag for jasmine_helper.js.
window.runningInBg = true;

var chromeSpecs = {
  'true': [],
  'false': []
};

(function() {
  var jasmineLoaded = false;
  var uiSyncReporter = null;
  var specScriptsLoadCount = 0;

  window.log = function log(text) {
    var logElem = doc.querySelector('#logs');
    var newPre = doc.createElement('pre');
    newPre.textContent = text;
    logElem.appendChild(newPre);
    console.log(text);
  };

  window.addActionButton = function addActionButton(name, func) {
    var btnsElem = doc.querySelector('#btns');
    var newButton = doc.createElement('div');
    newButton.textContent = name;
    newButton.className = 'btn';
    newButton.onclick = func;
    newButton.tabIndex = 1;
    btnsElem.appendChild(newButton);
  };

  window.injectScript = function injectScript(doc_, src, callback) {
    console.log('injecting script into ' + (doc_ == doc ? 'fg' : 'bg') + ': ' + src);
    var n = doc_.createElement('script');
    n.onload = callback;
    n.src = src;
    var head = doc_.querySelector('head');
    head.appendChild(n);
  };

  // Loads scripts in sequence.
  window.injectScripts = function injectScripts(doc, srcs, callback) {
    srcs = srcs.concat();
    function helper() {
      var src = srcs.shift();
      if (src) {
        injectScript(doc, src, helper);
      } else {
        callback && callback();
      }
    }
    helper();
  };

  function injectStyle(src) {
    var n = doc.createElement('link');
    n.setAttribute('rel', 'stylesheet');
    n.setAttribute('href', src);
    doc.querySelector('head').appendChild(n);
  }

  function UiSyncReporter() {
    this.bgElem = null;
    this.fgElem = null;
    this.intervalId = 0;
  }

  UiSyncReporter.prototype.reportRunnerStarting = function(runner) {
    window.clearInterval(this.intervalId);
    this.intervalId = window.setInterval(this.sync.bind(this), 200);
  };

  UiSyncReporter.prototype.sync = function() {
    this.fgElem = this.fgElem || doc && doc.getElementById('jasmine-container');
    this.bgElem = this.bgElem || document.getElementById('HTMLReporter');
    if (this.fgElem && this.bgElem) {
      this.fgElem.innerHTML = this.bgElem.outerHTML;
    }
  };

  UiSyncReporter.prototype.reportRunnerResults = function(runner) {
    window.clearInterval(this.intervalId);
    this.sync();
    this.intervalId = 0;
    // Remove the reporter node in case the tests are run again.
    this.bgElem.parentNode.removeChild(this.bgElem);
    this.bgElem = null;
  };

  function initJasmine(callback) {
    function afterJasmineLoaded() {
      // Make sure both pages use the same jasmine context.
      if (wnd) {
        wnd.jasmine = jasmine;
      }
      callback();
    }
    if (!jasmineLoaded) {
      jasmineLoaded = true;
      var scripts = [
          'spec_common/jasmine/jasmine.js',
          'spec_common/jasmine/jasmine-html.js',
          'spec_common/jasmine_helper.js'
          ];
      injectScripts(document, scripts, afterJasmineLoaded);
    } else {
      afterJasmineLoaded();
    }
  }

  function resetJasmineRunner(runner) {
    function resetQueue(queue) {
      queue.index = 0;
      queue.abort = false;
    }

    // Reset the results in case this is not the first run.
    var specs = runner.specs();
    for (var i = 0, spec; spec = specs[i]; ++i) {
      jasmine.NestedResults.call(spec.results());
      resetQueue(spec.queue);
    }
    var suites = runner.suites();
    for (var j = 0, suite; suite = suites[j]; ++j) {
      resetQueue(suite.queue);
    }
    resetQueue(runner.queue);
  }

  function runJasmine(finishCallback) {
    var jasmineEnv = jasmine.getEnv();
    jasmineEnv.updateInterval = 1000;
    resetJasmineRunner(jasmineEnv.currentRunner());

    // Re-using HtmlReporter causes an exception, so we recreate.
    jasmineEnv.reporter = new jasmine.MultiReporter();
    var htmlReporter = new jasmine.HtmlReporter();
    htmlReporter.logRunningSpecs = true;
    jasmineEnv.addReporter(htmlReporter);
<commit_msg>Set the Jasmine default wait timeout to 300ms.<commit_after>var wnd = null;
var doc = null;
// A flag for jasmine_helper.js.
window.runningInBg = true;

var chromeSpecs = {
  'true': [],
  'false': []
};

(function() {
  var jasmineLoaded = false;
  var uiSyncReporter = null;
  var specScriptsLoadCount = 0;

  window.log = function log(text) {
    var logElem = doc.querySelector('#logs');
    var newPre = doc.createElement('pre');
    newPre.textContent = text;
    logElem.appendChild(newPre);
    console.log(text);
  };

  window.addActionButton = function addActionButton(name, func) {
    var btnsElem = doc.querySelector('#btns');
    var newButton = doc.createElement('div');
    newButton.textContent = name;
    newButton.className = 'btn';
    newButton.onclick = func;
    newButton.tabIndex = 1;
    btnsElem.appendChild(newButton);
  };

  window.injectScript = function injectScript(doc_, src, callback) {
    console.log('injecting script into ' + (doc_ == doc ? 'fg' : 'bg') + ': ' + src);
    var n = doc_.createElement('script');
    n.onload = callback;
    n.src = src;
    var head = doc_.querySelector('head');
    head.appendChild(n);
  };

  // Loads scripts in sequence.
  window.injectScripts = function injectScripts(doc, srcs, callback) {
    srcs = srcs.concat();
    function helper() {
      var src = srcs.shift();
      if (src) {
        injectScript(doc, src, helper);
      } else {
        callback && callback();
      }
    }
    helper();
  };

  function injectStyle(src) {
    var n = doc.createElement('link');
    n.setAttribute('rel', 'stylesheet');
    n.setAttribute('href', src);
    doc.querySelector('head').appendChild(n);
  }

  function UiSyncReporter() {
    this.bgElem = null;
    this.fgElem = null;
    this.intervalId = 0;
  }

  UiSyncReporter.prototype.reportRunnerStarting = function(runner) {
    window.clearInterval(this.intervalId);
    this.intervalId = window.setInterval(this.sync.bind(this), 200);
  };

  UiSyncReporter.prototype.sync = function() {
    this.fgElem = this.fgElem || doc && doc.getElementById('jasmine-container');
    this.bgElem = this.bgElem || document.getElementById('HTMLReporter');
    if (this.fgElem && this.bgElem) {
      this.fgElem.innerHTML = this.bgElem.outerHTML;
    }
  };

  UiSyncReporter.prototype.reportRunnerResults = function(runner) {
    window.clearInterval(this.intervalId);
    this.sync();
    this.intervalId = 0;
    // Remove the reporter node in case the tests are run again.
    this.bgElem.parentNode.removeChild(this.bgElem);
    this.bgElem = null;
  };

  function initJasmine(callback) {
    function afterJasmineLoaded() {
      // Make sure both pages use the same jasmine context.
      if (wnd) {
        wnd.jasmine = jasmine;
      }
      callback();
    }
    if (!jasmineLoaded) {
      jasmineLoaded = true;
      var scripts = [
          'spec_common/jasmine/jasmine.js',
          'spec_common/jasmine/jasmine-html.js',
          'spec_common/jasmine_helper.js'
          ];
      injectScripts(document, scripts, afterJasmineLoaded);
    } else {
      afterJasmineLoaded();
    }
  }

  function resetJasmineRunner(runner) {
    function resetQueue(queue) {
      queue.index = 0;
      queue.abort = false;
    }

    // Reset the results in case this is not the first run.
    var specs = runner.specs();
    for (var i = 0, spec; spec = specs[i]; ++i) {
      jasmine.NestedResults.call(spec.results());
      resetQueue(spec.queue);
    }
    var suites = runner.suites();
    for (var j = 0, suite; suite = suites[j]; ++j) {
      resetQueue(suite.queue);
    }
    resetQueue(runner.queue);
  }

  function runJasmine(finishCallback) {
    var jasmineEnv = jasmine.getEnv();
    jasmineEnv.updateInterval = 1000;
    jasmineEnv.defaultTimeoutInterval = 300;
    resetJasmineRunner(jasmineEnv.currentRunner());

    // Re-using HtmlReporter causes an exception, so we recreate.
    jasmineEnv.reporter = new jasmine.MultiReporter();
    var htmlReporter = new jasmine.HtmlReporter();
    htmlReporter.logRunningSpecs = true;
    jasmineEnv.addReporter(htmlReporter);

{'fraction_non_alphanumeric': 0.13238538857563129, 'fraction_numerical': 0.004167688158862467, 'mean_word_length': 2.9975502204801567, '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': '4804408', 'n_tokens_mistral': 2682, 'n_tokens_neox': 2551, 'n_words': 545}