Bug 514667 - Let Mochitest run on IE

r=sayrer
This commit is contained in:
Sylvain Pasche 2009-09-16 02:54:56 +02:00
Родитель 158422604c
Коммит 0119e12256
2 изменённых файлов: 11 добавлений и 5 удалений

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

@ -8,6 +8,10 @@
* * Support the Test.Simple API used by MochiKit, to be able to test MochiKit
* itself against IE 5.5
*
* NOTE: Pay attention to cross-browser compatibility in this file. For
* instance, do not use const or JS > 1.5 features which are not yet
* implemented everywhere.
*
**/
if (typeof(SimpleTest) == "undefined") {
@ -549,7 +553,7 @@ var todo_is = SimpleTest.todo_is;
var todo_isnot = SimpleTest.todo_isnot;
var isDeeply = SimpleTest.isDeeply;
const gOldOnError = window.onerror;
var gOldOnError = window.onerror;
window.onerror = function simpletestOnerror(errorMsg, url, lineNumber) {
var funcIdentifier = "[SimpleTest/SimpleTest.js, window.onerror] ";

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

@ -201,7 +201,9 @@ TestRunner.countResults = function(doc) {
}
TestRunner.updateUI = function() {
var results = TestRunner.countResults($('testframe').contentDocument);
var testFrame = $('testframe');
var results = TestRunner.countResults(testFrame.contentDocument ||
testFrame.contentWindow.document);
var passCount = parseInt($("pass-count").innerHTML) + results.OK;
var failCount = parseInt($("fail-count").innerHTML) + results.notOK;
var todoCount = parseInt($("todo-count").innerHTML) + results.todo;
@ -227,9 +229,9 @@ TestRunner.updateUI = function() {
var row = $(trID);
var tds = row.getElementsByTagName("td");
tds[0].style.backgroundColor = "#0d0";
tds[0].textContent = results.OK;
tds[0].innerHTML = results.OK;
tds[1].style.backgroundColor = results.notOK > 0 ? "red" : "#0d0";
tds[1].textContent = results.notOK;
tds[1].innerHTML = results.notOK;
tds[2].style.backgroundColor = results.todo > 0 ? "orange" : "#0d0";
tds[2].textContent = results.todo;
tds[2].innerHTML = results.todo;
}