testing/mochitest/tests/index.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <html>
michael@0 2 <head>
michael@0 3 <!-- This harness does not work locally in Safari -->
michael@0 4 <script type="text/javascript" src="../MochiKit/MochiKit.js"></script>
michael@0 5 <script type="text/javascript" src="SimpleTest/MemoryStats.js"></script>
michael@0 6 <script type="text/javascript" src="SimpleTest/TestRunner.js"></script>
michael@0 7 <script type="text/javascript" src="SimpleTest/MozillaLogger.js"></script>
michael@0 8 <!--<link rel="stylesheet" type="text/css" href="/static/main.css" />-->
michael@0 9 </head>
michael@0 10 <body>
michael@0 11 <p><a href="#" id="runtests">Click To Run Tests</a></p>
michael@0 12 <!--<div id="mt_maketemplate">Make Template for Bug <input type="text" /></div>-->
michael@0 13 <script type="text/javascript">
michael@0 14
michael@0 15 TestRunner.logEnabled = true;
michael@0 16 TestRunner.logger = new Logger();
michael@0 17
michael@0 18 // Check the query string for arguments
michael@0 19 var params = parseQueryString(location.search.substring(1), true);
michael@0 20
michael@0 21 // log levels for console and logfile
michael@0 22 var fileLevel = params.fileLevel || null;
michael@0 23 var consoleLevel = params.consoleLevel || null;
michael@0 24
michael@0 25 // closeWhenDone tells us to close the browser when complete
michael@0 26 if (params.closeWhenDone) {
michael@0 27 TestRunner.onComplete = SpecialPowers.quit;
michael@0 28 }
michael@0 29
michael@0 30 // logFile to write our results
michael@0 31 if (params.logFile) {
michael@0 32 var spl = SpecialPowersLogger(params.logFile);
michael@0 33 TestRunner.logger.addListener("mozLogger", fileLevel + "", spl.getLogCallback());
michael@0 34 }
michael@0 35
michael@0 36 // if we get a quiet param, don't log to the console
michael@0 37 if (!params.quiet) {
michael@0 38 function dumpListener(msg) {
michael@0 39 dump("*** " + msg.num + " " + msg.level + " " + msg.info.join(' ') + "\n");
michael@0 40 }
michael@0 41 TestRunner.logger.addListener("dumpListener", consoleLevel + "", dumpListener);
michael@0 42 }
michael@0 43
michael@0 44 var RunSet = {}
michael@0 45 RunSet.runall = function() {
michael@0 46 TestRunner.runTests(
michael@0 47 'test_bug362788.xhtml'
michael@0 48 );
michael@0 49 };
michael@0 50 RunSet.reloadAndRunAll = function() {
michael@0 51 if (params.autorun) {
michael@0 52 window.location.href = window.location.href;
michael@0 53 } else if (location.search) {
michael@0 54 window.location.href = window.location.href + "&autorun=1";
michael@0 55 } else {
michael@0 56 window.location.href = window.location.href + "?autorun=1";
michael@0 57 }
michael@0 58 };
michael@0 59
michael@0 60 // run automatically if
michael@0 61 if (params.autorun) {
michael@0 62 RunSet.runall();
michael@0 63 }
michael@0 64
michael@0 65 // hook up our buttons
michael@0 66 connect("runtests", "onclick", RunSet, "reloadAndRunAll");
michael@0 67
michael@0 68 </script>
michael@0 69 <small>Based on the <a href="http://www.mochikit.com/">MochiKit</a> unit tests.</small>
michael@0 70 </body>
michael@0 71 </html>

mercurial