1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/tests/unit/test_nsIProcess_stress.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,27 @@ 1.4 +function run_test() { 1.5 + set_process_running_environment(); 1.6 + 1.7 + var file = get_test_program("TestQuickReturn"); 1.8 + var thread = Components.classes["@mozilla.org/thread-manager;1"] 1.9 + .getService().currentThread; 1.10 + 1.11 + for (var i = 0; i < 1000; i++) { 1.12 + var process = Components.classes["@mozilla.org/process/util;1"] 1.13 + .createInstance(Components.interfaces.nsIProcess); 1.14 + process.init(file); 1.15 + 1.16 + process.run(false, [], 0); 1.17 + 1.18 + try { 1.19 + process.kill(); 1.20 + } 1.21 + catch (e) { } 1.22 + 1.23 + // We need to ensure that we process any events on the main thread - 1.24 + // this allow threads to clean up properly and avoid out of memory 1.25 + // errors during the test. 1.26 + while (thread.hasPendingEvents()) 1.27 + thread.processNextEvent(false); 1.28 + } 1.29 + 1.30 +} 1.31 \ No newline at end of file