<commit_before><!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test Runner</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<script src="config.js?20111026"></script>
<script>
(function() {

  var container, reporter, summary, start;
  var currentTest, count;
  var tests = this['testCases'];


  window.onload = function() {
    container = document.getElementById('container');
    reporter = document.getElementById('reporter');
    summary = document.getElementById('summary');

    start = document.getElementById('start');
    start.setAttribute('autocomplete', 'off');
    start.onclick = startRun;

    if (location.search.indexOf('autorun') !== -1) {
      startRun();
    }

    var ua = document.getElementById('ua');
    ua.innerHTML = navigator.userAgent;
  };


  function startRun() {
    start.setAttribute('disabled', 'true');
    reset();
    testNext();
  }


  window.testNext = function() {
    var test = tests[currentTest++];

    if (test) {
      var url = getUrl(test);

      printHeader(test, url);
      load(url);
      summary.innerHTML = currentTest + ' / ' + tests.length +
          ' Running ' + test + ' ... ';
    }
    else {
      printSummary();
      start.removeAttribute('disabled');
    }
  };


  window.printResults = function(txt, style) {
    var d = document.createElement('div');
    d.innerHTML = txt;
    d.className = style;

    reporter.appendChild(d);
    reporter.scrollTop = reporter.scrollHeight;

    if (style in count) count[style] += 1;
  };


  function getUrl(test) {
    var url = '';

    if (test.indexOf('issues/') === 0) {
      url = test + '/test.html';
    }
    else if (test.indexOf('unit/') === 0) {
      url = 'sandbox.html?' + encodeURIComponent(test);
    }
    else if (test.indexOf('bootstrap/') === 0) {
      url = test + '.html';
    }
    else {
      url = 'sandbox.html?' + encodeURIComponent(test + '/program.js');
      url += '&t=' + new Date().getTime();
    }

    return url;
  }


  function load(url) {
    var frame = document.createElement('iframe');
    container.appendChild(frame);
    frame.src = url;
  }


  function printHeader(test, url) {
    var h = document.createElement('h3');
    h.innerHTML = '<a href="' + url + '">' + test + '</a>';
    reporter.appendChild(h);
  }


  function printSummary() {
    summary.innerHTML =
        'Passed: <span class="pass">' + count.pass + '</span> ' +
        'Failed: <span class="fail">' + count.fail + '</span> ' +
        'Errors: <span class="error">' + count.error + '</span>';
  }


  function reset() {
    reporter.innerHTML = '';
    currentTest = 0;
    count = { pass: 0, fail: 0, error: 0 };
  }

})();
</script>

<div id="container">
  <div id="banner">
    <div id="logo">Test Suite for sea.js</div>
    <div id="summary"></div>
  </div>
  <div id="reporter"></div>
  <button id="start">Start</button>
  <p id="ua"></p>
</div>

</body>
</html><commit_msg>improve test runner.html for mobile device<commit_after><!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
<title>Test Runner</title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<script src="config.js?20111026"></script>
<script>
(function() {

  var container, reporter, summary, start;
  var currentTest, count;
  var tests = this['testCases'];


  window.onload = function() {
    container = document.getElementById('container');
    reporter = document.getElementById('reporter');
    summary = document.getElementById('summary');

    start = document.getElementById('start');
    start.setAttribute('autocomplete', 'off');
    start.onclick = startRun;

    if (location.search.indexOf('autorun') !== -1) {
      startRun();
    }

    var ua = document.getElementById('ua');
    ua.innerHTML = navigator.userAgent;
  };


  function startRun() {
    start.setAttribute('disabled', 'true');
    reset();
    testNext();
  }


  window.testNext = function() {
    var test = tests[currentTest++];

    if (test) {
      var url = getUrl(test);

      printHeader(test, url);
      load(url);
      summary.innerHTML = currentTest + ' / ' + tests.length +
          ' Running ' + test + ' ... ';
    }
    else {
      printSummary();
      start.removeAttribute('disabled');
    }
  };


  window.printResults = function(txt, style) {
    var d = document.createElement('div');
    d.innerHTML = txt;
    d.className = style;

    reporter.appendChild(d);
    reporter.scrollTop = reporter.scrollHeight;

    if (style in count) count[style] += 1;
  };


  function getUrl(test) {
    var url = '';

    if (test.indexOf('issues/') === 0) {
      url = test + '/test.html';
    }
    else if (test.indexOf('unit/') === 0) {
      url = 'sandbox.html?' + encodeURIComponent(test);
    }
    else if (test.indexOf('bootstrap/') === 0) {
      url = test + '.html';
    }
    else {
      url = 'sandbox.html?' + encodeURIComponent(test + '/program.js');
      url += '&t=' + new Date().getTime();
    }

    return url;
  }


  function load(url) {
    var frame = document.createElement('iframe');
    container.appendChild(frame);
    frame.src = url;
  }


  function printHeader(test, url) {
    var h = document.createElement('h3');
    h.innerHTML = '<a href="' + url + '">' + test + '</a>';
    reporter.appendChild(h);
  }


  function printSummary() {
    summary.innerHTML =
        'Passed: <span class="pass">' + count.pass + '</span> ' +
        'Failed: <span class="fail">' + count.fail + '</span> ' +
        'Errors: <span class="error">' + count.error + '</span>';
  }


  function reset() {
    reporter.innerHTML = '';
    currentTest = 0;
    count = { pass: 0, fail: 0, error: 0 };
  }

})();
</script>

<div id="container">
  <div id="banner">
    <div id="logo">Test Suite for sea.js</div>
    <div id="summary"></div>
  </div>
  <div id="reporter"></div>
  <button id="start">Start</button>
  <p id="ua"></p>
</div>

</body>
</html>
{'fraction_non_alphanumeric': 0.18735440931780367, 'fraction_numerical': 0.0066555740432612314, 'mean_word_length': 2.903246753246753, 'pattern_counts': {'":': 0, '<': 78, '<?xml version=': 0, '>': 78, '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': '6912720', 'n_tokens_mistral': 2010, 'n_tokens_neox': 1933, 'n_words': 419}