зеркало из https://github.com/mozilla/gecko-dev.git
backout 7918fee254ae, no comments or user in patch
This commit is contained in:
Родитель
4a663b427b
Коммит
e9f3d2cdd6
|
@ -4,7 +4,6 @@
|
|||
<script type="text/javascript" src="/tests/SimpleTest/LogController.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/TestRunner.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/MozillaFileLogger.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/quit.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/setup.js"></script>
|
||||
</head>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -410,9 +410,9 @@ class WebSocketServer(object):
|
|||
|
||||
class Mochitest(object):
|
||||
# Path to the test script on the server
|
||||
TEST_PATH = "tests"
|
||||
CHROME_PATH = "redirect.html"
|
||||
PLAIN_LOOP_PATH = "plain-loop.html"
|
||||
TEST_PATH = "/tests/"
|
||||
CHROME_PATH = "/redirect.html";
|
||||
PLAIN_LOOP_PATH = "/plain-loop.html";
|
||||
urlOpts = []
|
||||
runSSLTunnel = True
|
||||
vmwareHelper = None
|
||||
|
@ -440,15 +440,15 @@ class Mochitest(object):
|
|||
def buildTestPath(self, options):
|
||||
""" Build the url path to the specific test harness and test file or directory """
|
||||
testHost = "http://mochi.test:8888"
|
||||
testURL = ("/").join([testHost, self.TEST_PATH, options.testPath])
|
||||
if os.path.isfile(os.path.join(self.oldcwd, os.path.dirname(__file__), self.TEST_PATH, options.testPath)) and options.loops > 0:
|
||||
testURL = ("/").join([testHost, self.PLAIN_LOOP_PATH])
|
||||
testURL = testHost + self.TEST_PATH + options.testPath
|
||||
if os.path.isfile(self.oldcwd + self.TEST_PATH + options.testPath) and options.loops > 0:
|
||||
testURL = testHost + self.PLAIN_LOOP_PATH
|
||||
if options.chrome or options.a11y:
|
||||
testURL = ("/").join([testHost, self.CHROME_PATH])
|
||||
testURL = testHost + self.CHROME_PATH
|
||||
elif options.browserChrome:
|
||||
testURL = "about:blank"
|
||||
elif options.ipcplugins:
|
||||
testURL = ("/").join([testHost, self.TEST_PATH, "dom/plugins/test"])
|
||||
testURL = testHost + self.TEST_PATH + "dom/plugins/test"
|
||||
return testURL
|
||||
|
||||
def startWebSocketServer(self, options, debuggerInfo):
|
||||
|
@ -579,8 +579,8 @@ class Mochitest(object):
|
|||
self.urlOpts.append("hideResultsTable=1")
|
||||
if options.loops:
|
||||
self.urlOpts.append("loops=%d" % options.loops)
|
||||
if os.path.isfile(os.path.join(self.oldcwd, os.path.dirname(__file__), self.TEST_PATH, options.testPath)) and options.loops > 0:
|
||||
self.urlOpts.append("testname=%s" % ("/").join([self.TEST_PATH, options.testPath]))
|
||||
if os.path.isfile(self.oldcwd + self.TEST_PATH + options.testPath) and options.loops > 0:
|
||||
self.urlOpts.append("testname=%s" % (self.TEST_PATH + options.testPath))
|
||||
|
||||
def cleanup(self, manifest, options):
|
||||
""" remove temporary files and profile """
|
||||
|
|
|
@ -243,36 +243,27 @@ TestRunner.resetTests = function(listURLs) {
|
|||
/*
|
||||
* Used to run a single test in a loop and update the UI with the results
|
||||
*/
|
||||
TestRunner.loopTest = function(testPath) {
|
||||
//must set the following line so that TestHarness.updateUI finds the right div to update
|
||||
document.getElementById("current-test-path").innerHTML = testPath;
|
||||
var numLoops = TestRunner.loops;
|
||||
var completed = 0; // keep track of how many tests have finished
|
||||
|
||||
// function to kick off the test and to check when the test is complete
|
||||
function checkComplete() {
|
||||
var testWindow = window.open(testPath, 'test window'); // kick off the test or find the active window
|
||||
if (testWindow.document.readyState == "complete") {
|
||||
// the test is complete -> mark as complete
|
||||
TestRunner.currentTestURL = testPath;
|
||||
TestRunner.updateUI(testWindow.SimpleTest._tests);
|
||||
testWindow.close();
|
||||
if (TestRunner.loops == completed && TestRunner.onComplete) {
|
||||
TestRunner.onComplete();
|
||||
TestRunner.loopTest = function(testPath){
|
||||
var numLoops = TestRunner.loops;
|
||||
while(numLoops >= 0){
|
||||
//must set the following line so that TestHarness.updateUI finds the right div to update
|
||||
$("current-test-path").innerHTML = testPath;
|
||||
function checkComplete() {
|
||||
var testWindow = window.open(testPath, 'test window');
|
||||
if (testWindow.document.readyState == "complete") {
|
||||
TestRunner.currentTestURL = testPath;
|
||||
TestRunner.updateUI(testWindow.SimpleTest._tests);
|
||||
testWindow.close();
|
||||
} else {
|
||||
setTimeout(checkComplete, 1000);
|
||||
}
|
||||
completed++;
|
||||
}
|
||||
else {
|
||||
// wait and check later
|
||||
setTimeout(checkComplete, 1000);
|
||||
}
|
||||
}
|
||||
while (numLoops >= 0) {
|
||||
checkComplete();
|
||||
numLoops--;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Run the next test. If no test remains, calls onComplete().
|
||||
**/
|
||||
|
|
Загрузка…
Ссылка в новой задаче