Bug 620101 - Intermittent failing in test_nsIProcess.js | TEST-UNEXPECTED-FAIL | Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIProcess.run]; r=glandium,a=test-only fix

This commit is contained in:
Mark Banner 2011-01-13 17:51:40 +00:00
Родитель 3e427b29db
Коммит 93e1b98628
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -235,6 +235,8 @@ function test_notify_killed()
function test_kill_2()
{
var file = get_test_program("TestQuickReturn");
var thread = Components.classes["@mozilla.org/thread-manager;1"]
.getService().currentThread;
for (var i = 0; i < 1000; i++) {
var process = Components.classes["@mozilla.org/process/util;1"]
@ -248,6 +250,12 @@ function test_kill_2()
}
catch (e) { }
}
// We need to ensure that we process any events on the main thread -
// this allow threads to clean up properly and avoid out of memory
// errors during the test.
while (thread.hasPendingEvents())
thread.processNextEvent(false);
}
function run_test() {