Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 #!/usr/bin/env python
3 import os
4 import time
5 import unittest
6 import proctest
7 from mozprocess import processhandler
9 here = os.path.dirname(os.path.abspath(__file__))
11 class ProcTestKill(proctest.ProcTest):
12 """ Class to test various process tree killing scenatios """
14 # This test should ideally be a part of test_mozprocess_kill.py
15 # It has been separated for the purpose of tempporarily disabling it.
16 # See https://bugzilla.mozilla.org/show_bug.cgi?id=921632
17 def test_process_kill_broad_wait(self):
18 """Process is started, we use a broad process tree, we let it spawn
19 for a bit, we kill it"""
21 p = processhandler.ProcessHandler([self.python, self.proclaunch, "process_normal_broad_python.ini"],
22 cwd=here)
23 p.run()
24 # Let the tree spawn a bit, before attempting to kill
25 time.sleep(3)
26 p.kill()
28 detected, output = proctest.check_for_process(self.proclaunch)
29 self.determine_status(detected,
30 output,
31 p.proc.returncode,
32 p.didTimeout,
33 expectedfail=('returncode',))
35 if __name__ == '__main__':
36 unittest.main()