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.
michael@0 | 1 | #!/usr/bin/env python |
michael@0 | 2 | |
michael@0 | 3 | import os |
michael@0 | 4 | import time |
michael@0 | 5 | import unittest |
michael@0 | 6 | import proctest |
michael@0 | 7 | from mozprocess import processhandler |
michael@0 | 8 | |
michael@0 | 9 | here = os.path.dirname(os.path.abspath(__file__)) |
michael@0 | 10 | |
michael@0 | 11 | class ProcTestKill(proctest.ProcTest): |
michael@0 | 12 | """ Class to test various process tree killing scenatios """ |
michael@0 | 13 | |
michael@0 | 14 | # This test should ideally be a part of test_mozprocess_kill.py |
michael@0 | 15 | # It has been separated for the purpose of tempporarily disabling it. |
michael@0 | 16 | # See https://bugzilla.mozilla.org/show_bug.cgi?id=921632 |
michael@0 | 17 | def test_process_kill_broad_wait(self): |
michael@0 | 18 | """Process is started, we use a broad process tree, we let it spawn |
michael@0 | 19 | for a bit, we kill it""" |
michael@0 | 20 | |
michael@0 | 21 | p = processhandler.ProcessHandler([self.python, self.proclaunch, "process_normal_broad_python.ini"], |
michael@0 | 22 | cwd=here) |
michael@0 | 23 | p.run() |
michael@0 | 24 | # Let the tree spawn a bit, before attempting to kill |
michael@0 | 25 | time.sleep(3) |
michael@0 | 26 | p.kill() |
michael@0 | 27 | |
michael@0 | 28 | detected, output = proctest.check_for_process(self.proclaunch) |
michael@0 | 29 | self.determine_status(detected, |
michael@0 | 30 | output, |
michael@0 | 31 | p.proc.returncode, |
michael@0 | 32 | p.didTimeout, |
michael@0 | 33 | expectedfail=('returncode',)) |
michael@0 | 34 | |
michael@0 | 35 | if __name__ == '__main__': |
michael@0 | 36 | unittest.main() |