Bug 469042 - Implement SimpleTest.executeSoon for non-Mozilla browsers. r=sayrer

This commit is contained in:
Jeff Walden 2009-01-16 15:34:03 -08:00
Родитель 9dd8a0c775
Коммит 12deaa91e1
1 изменённых файлов: 12 добавлений и 7 удалений

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

@ -206,14 +206,19 @@ SimpleTest.waitForExplicitFinish = function () {
* working (or finish).
*/
SimpleTest.executeSoon = function(aFunc) {
var tm = Components.classes["@mozilla.org/thread-manager;1"]
.getService(Components.interfaces.nsIThreadManager);
if ("Components" in window && "classes" in window.Components) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var tm = Components.classes["@mozilla.org/thread-manager;1"]
.getService(Components.interfaces.nsIThreadManager);
tm.mainThread.dispatch({
run: function() {
aFunc();
}
}, Components.interfaces.nsIThread.DISPATCH_NORMAL);
tm.mainThread.dispatch({
run: function() {
aFunc();
}
}, Components.interfaces.nsIThread.DISPATCH_NORMAL);
} else {
setTimeout(aFunc, 0);
}
}
/**