Bug 423035: can't run single chrome/a11y test automatically; r=Waldo

This commit is contained in:
mnyromyr@tprac.de 2008-03-18 12:57:22 -07:00
Родитель d876f2b812
Коммит bbb6a2610a
5 изменённых файлов: 26 добавлений и 26 удалений

Просмотреть файл

@ -2,14 +2,10 @@
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/static/harness.css"
type="text/css"?>
<?xul-overlay href="chrome://mochikit/content/harness-overlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Accessibility Chrome Test Harness"
id="browserTestOverlay"
aonload="loadTests('chrome');">
<script type="text/javascript">
gDir = "a11y";
</script>
directory="a11y">
</window>

Просмотреть файл

@ -12,14 +12,15 @@
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/TestRunner.js"/>
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/MozillaFileLogger.js"/>
src="chrome://mochikit/content/tests/SimpleTest/MozillaFileLogger.js"/>
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/quit.js" />
<script type="text/javascript"
<script type="text/javascript"
src="chrome://mochikit/content/tests/SimpleTest/setup.js" />
<script type="application/javascript;version=1.7"><![CDATA[
function loadTests(aDir)
function loadTests()
{
var dir = document.documentElement.getAttribute('directory');
// Find our chrome dir
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
@ -32,7 +33,7 @@
getService(Ci.nsIFileProtocolHandler);
var chromeDir = fileHandler.getFileFromURLSpec(resolvedURI.spec);
chromeDir = chromeDir.parent.QueryInterface(Ci.nsILocalFile);
chromeDir.appendRelativePath(aDir);
chromeDir.appendRelativePath(dir);
// load server.js in so we can share template functions
var scriptLoader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
@ -43,7 +44,7 @@
// generate our test list
srvScope.makeTags();
var url = "chrome://mochikit/content/" + aDir + "/";
var url = "chrome://mochikit/content/" + dir + "/";
var [links, count] = srvScope.list(url, chromeDir, true);
var listContent = srvScope.linksToListItems(links);
var tableContent = srvScope.linksToTableRows(links);
@ -54,11 +55,14 @@
$("wrapper").innerHTML += " "; // redraw the table
}
gTestList = eval(srvScope.jsonArrayOfTestFiles(links));
connect(window, 'onload', populate);
connect(window, 'onload', hookup);
}
populate();
hookup();
loadTests(gDir);
// if we got passed a test path, just run that single test
if ("testPath" in params && params.testPath)
window.location.href = url + params.testPath;
}
window.addEventListener("load", loadTests, false)
]]>
</script>

Просмотреть файл

@ -2,14 +2,10 @@
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/static/harness.css"
type="text/css"?>
<?xul-overlay href="chrome://mochikit/content/harness-overlay.xul"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Chrome Test Harness"
id="browserTestOverlay"
aonload="loadTests('chrome');">
<script type="text/javascript">
gDir = "chrome";
</script>
directory="chrome">
</window>

Просмотреть файл

@ -217,13 +217,13 @@ sub main {
my $url;
if ($do_chrome) {
$url = CHROMETESTS_URL . ($test_path ? $test_path : "") . "?";
$url = CHROMETESTS_URL . "?" . ($test_path ? "testPath=" . $test_path : "");
} elsif ($do_browser_chrome) {
# Tests will run from an overlay, no need to load any URL. We'll include
# the test path in the config file so the browser chrome harness can use it.
$url = "about:blank";
} elsif ($do_a11y) {
$url = A11YTESTS_URL . ($test_path ? $test_path : "") . "?";
$url = A11YTESTS_URL . "?" . ($test_path ? "testPath=" . $test_path : "");
} else {
$url = TESTS_URL . ($test_path ? $test_path : "") . "?";
}

Просмотреть файл

@ -299,17 +299,21 @@ Are you executing $objdir/_tests/testing/mochitest/runtests.py?"""
# <http://mochikit.com/doc/html/MochiKit/Logging.html>
testURL = TESTS_URL + options.testPath
urlOpts = []
if options.chrome:
testURL = CHROMETESTS_URL + options.testPath
testURL = CHROMETESTS_URL
if options.testPath:
urlOpts.append("testPath=" + encodeURIComponent(options.testPath))
elif options.a11y:
testURL = A11YTESTS_URL + options.testPath
testURL = A11YTESTS_URL
if options.testPath:
urlOpts.append("testPath=" + encodeURIComponent(options.testPath))
elif options.browserChrome:
testURL = "about:blank"
if options.browserChrome:
makeTestConfig(options)
else:
urlOpts = []
if options.autorun:
urlOpts.append("autorun=1")
if options.closeWhenDone: