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