2 <?xml-stylesheet href=
"chrome://global/skin" type=
"text/css"?>
4 <overlay id=
"browserTestOverlay"
5 xmlns:
html=
"http://www.w3.org/1999/xhtml"
6 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
7 xmlns:
xul=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
10 <script type=
"application/javascript"
11 src=
"chrome://mochikit/content/MochiKit/packed.js" />
12 <script type=
"text/javascript"
13 src=
"chrome://mochikit/content/tests/SimpleTest/TestRunner.js"/>
14 <script type=
"text/javascript"
15 src=
"chrome://mochikit/content/tests/SimpleTest/MozillaFileLogger.js"/>
16 <script type=
"text/javascript"
17 src=
"chrome://mochikit/content/tests/SimpleTest/quit.js" />
18 <script type=
"text/javascript"
19 src=
"chrome://mochikit/content/tests/SimpleTest/setup.js" />
20 <script type=
"application/javascript;version=1.7"><![CDATA[
23 window.removeEventListener(
"load", loadTests, false);
25 var dir = document.documentElement.getAttribute('directory');
26 var url =
"chrome://mochikit/content/" + dir +
"/";
27 // Find our chrome dir
28 var ios = Cc[
"@mozilla.org/network/io-service;1"].
29 getService(Ci.nsIIOService);
30 var chromeURI = ios.newURI(
"chrome://mochikit/content/",
32 var resolvedURI = Cc[
"@mozilla.org/chrome/chrome-registry;1"].
33 getService(Ci.nsIChromeRegistry).
34 convertChromeURL(chromeURI);
35 var fileHandler = Cc[
"@mozilla.org/network/protocol;1?name=file"].
36 getService(Ci.nsIFileProtocolHandler);
37 var chromeDir = fileHandler.getFileFromURLSpec(resolvedURI.spec);
38 chromeDir = chromeDir.parent.QueryInterface(Ci.nsILocalFile);
39 chromeDir.appendRelativePath(dir);
42 if (
"testPath" in params && params.testPath) {
43 var extraPath = params.testPath;
44 var pathToCheck = chromeDir.clone().QueryInterface(Ci.nsILocalFile);
45 var pathIsFile = false;
47 var pathParts = extraPath.toString().split(
"/");
48 for each (var part in pathParts) {
49 pathToCheck.append(part);
51 if (pathToCheck.isDirectory()) {
52 for each (var part in pathParts) {
53 chromeDir.append(part);
55 url += extraPath +
"/";
65 singleTestPath = url + params.testPath;
68 // load server.js in so we can share template functions
69 var scriptLoader = Cc[
"@mozilla.org/moz/jssubscript-loader;1"].
70 getService(Ci.mozIJSSubScriptLoader);
72 scriptLoader.loadSubScript(
"chrome://mochikit/content/server.js",
75 // generate our test list
77 var [links, count] = srvScope.list(url, chromeDir, true);
78 var tableContent = srvScope.linksToTableRows(links,
0);
80 $(
"test-table").innerHTML += tableContent;
82 gTestList = eval(srvScope.jsonArrayOfTestFiles(links));
86 // if we got passed a test path, just run that single test
88 window.location.href = singleTestPath;
91 window.addEventListener(
"load", loadTests, false);
96 <button label=
"Run Chrome Tests" id=
"runtests" flex=
"1"/>
98 <body xmlns=
"http://www.w3.org/1999/xhtml" id=
"xulharness">
99 <div class=
"container">
100 <p style=
"float:right;">
101 <small>Based on the MochiKit unit tests.
</small>
104 <h1 id=
"indicator">Status
</h1>
105 <h2 id=
"pass">Passed:
<span id=
"pass-count">0</span></h2>
106 <h2 id=
"fail">Failed:
<span id=
"fail-count">0</span></h2>
107 <h2 id=
"fail">Todo:
<span id=
"todo-count">0</span></h2>
109 <div class=
"clear"></div>
110 <div id=
"current-test">
111 <b>Currently Executing:
<span id=
"current-test-path">_
</span></b>
113 <div class=
"clear"></div>
114 <div class=
"frameholder">
115 <iframe scrolling=
"no" id=
"testframe" width=
"500"></iframe>
117 <div class=
"clear"></div>
119 <a href=
"#" id=
"toggleNonTests">Show Non-Tests
</a>
123 <table cellpadding=
"0" cellspacing=
"0">
124 <!-- tbody needed to avoid bug 494546 causing performance problems -->
125 <tbody id=
"test-table">