testing/mochitest/harness.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mochitest/harness.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,114 @@
     1.4 +<?xml version="1.0"?>
     1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     1.6 +<?xml-stylesheet href="chrome://mochikit/content/static/harness.css" 
     1.7 +                 type="text/css"?>
     1.8 +
     1.9 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    1.10 +        title="Chrome Test Harness"
    1.11 +        directory="chrome">
    1.12 +
    1.13 +  <script type="text/javascript"
    1.14 +          src="chrome://mochikit/content/tests/SimpleTest/LogController.js"/>
    1.15 +  <script type="text/javascript"
    1.16 +          src="chrome://mochikit/content/tests/SimpleTest/MemoryStats.js"/>
    1.17 +  <script type="text/javascript"
    1.18 +          src="chrome://mochikit/content/tests/SimpleTest/TestRunner.js"/>
    1.19 +  <script type="text/javascript"
    1.20 +          src="chrome://mochikit/content/tests/SimpleTest/MozillaLogger.js"/>
    1.21 +  <script type="application/javascript"
    1.22 +          src="chrome://mochikit/content/chrome-harness.js" />
    1.23 +  <script type="application/javascript"
    1.24 +          src="chrome://mochikit/content/chunkifyTests.js" />
    1.25 +  <script type="application/javascript"
    1.26 +          src="chrome://mochikit/content/manifestLibrary.js" />
    1.27 +  <script type="text/javascript"
    1.28 +          src="chrome://mochikit/content/tests/SimpleTest/setup.js" />
    1.29 +  <script type="application/javascript;version=1.7"><![CDATA[
    1.30 +
    1.31 +if (Cc === undefined) {
    1.32 +  var Cc = Components.classes;
    1.33 +  var Ci = Components.interfaces;
    1.34 +}
    1.35 +
    1.36 +function loadTests()
    1.37 +{
    1.38 +  window.removeEventListener("load", loadTests, false);
    1.39 +  getTestList({}, linkAndHookup);
    1.40 +}
    1.41 + 
    1.42 +function linkAndHookup(links) {
    1.43 +  // load server.js in so we can share template functions
    1.44 +  var scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
    1.45 +                       getService(Ci.mozIJSSubScriptLoader);
    1.46 +  var srvScope = {};
    1.47 +  scriptLoader.loadSubScript('chrome://mochikit/content/server.js',
    1.48 +                             srvScope);
    1.49 +
    1.50 +  // generate our test list
    1.51 +  srvScope.makeTags();
    1.52 +  var tableContent = srvScope.linksToTableRows(links, 0);
    1.53 +
    1.54 +  function populate() {
    1.55 +    document.getElementById("test-table").innerHTML += tableContent;
    1.56 +  }
    1.57 +  gTestList = eval(srvScope.jsonArrayOfTestFiles(links));
    1.58 +  populate();
    1.59 +
    1.60 +  hookup();
    1.61 +}
    1.62 +
    1.63 +    window.addEventListener("load", loadTests, false);
    1.64 +  ]]>
    1.65 +  </script>
    1.66 +
    1.67 +  <vbox>   
    1.68 +    <button label="Run Chrome Tests" id="runtests" flex="1"/>
    1.69 +
    1.70 +    <body xmlns="http://www.w3.org/1999/xhtml" id="xulharness">
    1.71 +      <!--TODO: this should be separated into a file that both this file and server.js uses-->
    1.72 +      <div class="container">
    1.73 +        <p style="float:right;">
    1.74 +          <small>Based on the MochiKit unit tests.</small>
    1.75 +        </p>
    1.76 +        <div class="status">
    1.77 +          <h1 id="indicator">Status</h1>
    1.78 +          <h2 id="pass">Passed: <span id="pass-count">0</span></h2>
    1.79 +          <h2 id="fail">Failed: <span id="fail-count">0</span></h2>
    1.80 +          <h2 id="fail">Todo: <span id="todo-count">0</span></h2>
    1.81 +        </div>
    1.82 +        <div class="clear"></div>
    1.83 +        <div id="current-test">
    1.84 +          <b>Currently Executing: <span id="current-test-path">_</span></b>
    1.85 +        </div>
    1.86 +        <div class="clear"></div>
    1.87 +        <div class="frameholder">
    1.88 +          <iframe type="content" scrolling="no" id="testframe" width="550" height="350"></iframe>
    1.89 +        </div>
    1.90 +        <div class="clear"></div>
    1.91 +        <div class="toggle">
    1.92 +          <a href="#" id="toggleNonTests">Show Non-Tests</a>
    1.93 +          <br />
    1.94 +        </div>
    1.95 +        <div id="wrapper">
    1.96 +          <table cellpadding="0" cellspacing="0">
    1.97 +          <!-- tbody needed to avoid bug 494546 causing performance problems -->
    1.98 +            <tbody id="test-table">
    1.99 +              <tr>
   1.100 +                <td>Passed</td>
   1.101 +                <td>Failed</td>
   1.102 +                <td>Todo</td>
   1.103 +                <td>Test Files</td>
   1.104 +              </tr>
   1.105 +            </tbody>
   1.106 +          </table>
   1.107 +          <br/>
   1.108 +          <table cellpadding="0" cellspacing="0" border="1" bordercolor="red">
   1.109 +          <!-- tbody needed to avoid bug 494546 causing performance problems -->
   1.110 +            <tbody id="fail-table">
   1.111 +            </tbody>
   1.112 +          </table>
   1.113 +        </div>
   1.114 +      </div>
   1.115 +    </body>
   1.116 +  </vbox>
   1.117 +</window>

mercurial