testing/mochitest/tests/index.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mochitest/tests/index.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,71 @@
     1.4 +<html>
     1.5 +<head>
     1.6 +    <!-- This harness does not work locally in Safari -->
     1.7 +    <script type="text/javascript" src="../MochiKit/MochiKit.js"></script>
     1.8 +    <script type="text/javascript" src="SimpleTest/MemoryStats.js"></script>
     1.9 +    <script type="text/javascript" src="SimpleTest/TestRunner.js"></script>
    1.10 +    <script type="text/javascript" src="SimpleTest/MozillaLogger.js"></script>
    1.11 +    <!--<link rel="stylesheet" type="text/css" href="/static/main.css" />-->
    1.12 +</head>
    1.13 +<body>
    1.14 +<p><a href="#" id="runtests">Click To Run Tests</a></p>
    1.15 +<!--<div id="mt_maketemplate">Make Template for Bug <input type="text" /></div>-->
    1.16 +<script type="text/javascript">
    1.17 +
    1.18 +TestRunner.logEnabled = true;
    1.19 +TestRunner.logger = new Logger();
    1.20 +
    1.21 +// Check the query string for arguments
    1.22 +var params = parseQueryString(location.search.substring(1), true);
    1.23 +
    1.24 +// log levels for console and logfile
    1.25 +var fileLevel =  params.fileLevel || null;
    1.26 +var consoleLevel = params.consoleLevel || null;
    1.27 +
    1.28 +// closeWhenDone tells us to close the browser when complete
    1.29 +if (params.closeWhenDone) {
    1.30 +  TestRunner.onComplete = SpecialPowers.quit;
    1.31 +}
    1.32 +
    1.33 +// logFile to write our results
    1.34 +if (params.logFile) {
    1.35 +  var spl = SpecialPowersLogger(params.logFile);
    1.36 +  TestRunner.logger.addListener("mozLogger", fileLevel + "", spl.getLogCallback());
    1.37 +}
    1.38 +
    1.39 +// if we get a quiet param, don't log to the console
    1.40 +if (!params.quiet) {
    1.41 +  function dumpListener(msg) {
    1.42 +    dump("*** " + msg.num + " " + msg.level + " " + msg.info.join(' ') + "\n");
    1.43 +  }
    1.44 +  TestRunner.logger.addListener("dumpListener", consoleLevel + "", dumpListener);
    1.45 +}
    1.46 +
    1.47 +var RunSet = {}
    1.48 +RunSet.runall = function() {
    1.49 +  TestRunner.runTests(
    1.50 +      'test_bug362788.xhtml'
    1.51 +  );
    1.52 +};
    1.53 +RunSet.reloadAndRunAll = function() {
    1.54 +  if (params.autorun) {
    1.55 +    window.location.href = window.location.href;
    1.56 +  } else if (location.search) {
    1.57 +    window.location.href = window.location.href + "&autorun=1";
    1.58 +  } else {
    1.59 +    window.location.href = window.location.href + "?autorun=1";
    1.60 +  }
    1.61 +};
    1.62 +
    1.63 +// run automatically if 
    1.64 +if (params.autorun) {
    1.65 +  RunSet.runall();
    1.66 +}
    1.67 +
    1.68 +// hook up our buttons
    1.69 +connect("runtests", "onclick", RunSet, "reloadAndRunAll");
    1.70 +
    1.71 +</script>
    1.72 +<small>Based on the <a href="http://www.mochikit.com/">MochiKit</a> unit tests.</small>
    1.73 +</body>
    1.74 +</html>

mercurial