зеркало из https://github.com/mozilla/gecko-dev.git
Bug 469042 - Implement SimpleTest.executeSoon for non-Mozilla browsers. r=sayrer
This commit is contained in:
Родитель
9dd8a0c775
Коммит
12deaa91e1
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче