зеркало из https://github.com/mozilla/gecko-dev.git
Add callback to allow browser based tests to report test results to stdout, no bug, not part of the build
This commit is contained in:
Родитель
62d2480021
Коммит
91af505e5b
|
@ -1,5 +1,9 @@
|
|||
if (window.opener && window.opener.runNextTest)
|
||||
{
|
||||
if (window.opener.reportCallBack)
|
||||
{
|
||||
window.opener.reportCallBack(window.opener.gWindow);
|
||||
}
|
||||
setTimeout('window.opener.runNextTest()', 250);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -62,6 +62,27 @@ function userOnAfterPage()
|
|||
win.__Report = win.reportHTML;
|
||||
win.reportHTML = function () { win.__Report(); gPageCompleted = true; };
|
||||
|
||||
|
||||
win.reportCallBack = function (testwin)
|
||||
{
|
||||
if (testwin.wrappedJSObject)
|
||||
{
|
||||
testwin = testwin.wrappedJSObject;
|
||||
}
|
||||
var testcases = testwin.testcases;
|
||||
for (var i = 0; i < testcases.length; i++)
|
||||
{
|
||||
var testcase = testcases[i];
|
||||
cdump('testname: ' + testcase.name + ' ' +
|
||||
'bug: ' + testcase.bugnumber + ' ' +
|
||||
(testcase.passed ? 'PASSED':'FAILED') + ' ' +
|
||||
'description: ' + testcase.description + ' ' +
|
||||
'expected: ' + testcase.expect + ' ' +
|
||||
'actual: ' + testcase.actual + ' ' +
|
||||
'reason: ' + testcase.reason);
|
||||
}
|
||||
};
|
||||
|
||||
// only report failures
|
||||
win.document.forms.testCases.failures.checked = true;
|
||||
// these calls are all async
|
||||
|
|
|
@ -63,6 +63,26 @@ function userOnAfterPage()
|
|||
win.__Report = win.reportHTML;
|
||||
win.reportHTML = function () { win.__Report(); gPageCompleted = true; };
|
||||
|
||||
win.reportCallBack = function (testwin)
|
||||
{
|
||||
if (testwin.wrappedJSObject)
|
||||
{
|
||||
testwin = testwin.wrappedJSObject;
|
||||
}
|
||||
var testcases = testwin.testcases;
|
||||
for (var i = 0; i < testcases.length; i++)
|
||||
{
|
||||
var testcase = testcases[i];
|
||||
cdump('testname: ' + testcase.name + ' ' +
|
||||
'bug: ' + testcase.bugnumber + ' ' +
|
||||
(testcase.passed ? 'PASSED':'FAILED') + ' ' +
|
||||
'description: ' + testcase.description + ' ' +
|
||||
'expected: ' + testcase.expect + ' ' +
|
||||
'actual: ' + testcase.actual + ' ' +
|
||||
'reason: ' + testcase.reason);
|
||||
}
|
||||
};
|
||||
|
||||
// only report failures
|
||||
win.document.forms.testCases.failures.checked = true;
|
||||
// these calls are all async
|
||||
|
|
|
@ -69,6 +69,19 @@ function checkTestCompleted()
|
|||
if (win.gPageCompleted)
|
||||
{
|
||||
gPageCompleted = true;
|
||||
|
||||
var testcases = win.testcases;
|
||||
for (var i = 0; i < testcases.length; i++)
|
||||
{
|
||||
var testcase = testcases[i];
|
||||
cdump('testname: ' + testcase.name + ' ' +
|
||||
'bug: ' + testcase.bugnumber + ' ' +
|
||||
(testcase.passed ? 'PASSED':'FAILED') + ' ' +
|
||||
'description: ' + testcase.description + ' ' +
|
||||
'expected: ' + testcase.expect + ' ' +
|
||||
'actual: ' + testcase.actual + ' ' +
|
||||
'reason: ' + testcase.reason);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -68,6 +68,19 @@ function checkTestCompleted()
|
|||
if (win.gPageCompleted)
|
||||
{
|
||||
gPageCompleted = true;
|
||||
|
||||
var testcases = win.testcases;
|
||||
for (var i = 0; i < testcases.length; i++)
|
||||
{
|
||||
var testcase = testcases[i];
|
||||
cdump('testname: ' + testcase.name + ' ' +
|
||||
'bug: ' + testcase.bugnumber + ' ' +
|
||||
(testcase.passed ? 'PASSED':'FAILED') + ' ' +
|
||||
'description: ' + testcase.description + ' ' +
|
||||
'expected: ' + testcase.expect + ' ' +
|
||||
'actual: ' + testcase.actual + ' ' +
|
||||
'reason: ' + testcase.reason);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче