OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # pylint: disable=W0702 | |
6 | |
7 import os | 5 import os |
8 import signal | 6 import signal |
9 import subprocess | 7 import subprocess |
10 import sys | 8 import sys |
11 import time | 9 import time |
12 | 10 |
13 | 11 |
14 def _IsLinux(): | 12 def _IsLinux(): |
15 """Return True if on Linux; else False.""" | 13 """Return True if on Linux; else False.""" |
16 return sys.platform.startswith('linux') | 14 return sys.platform.startswith('linux') |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 47 |
50 def Stop(self): | 48 def Stop(self): |
51 """Stop Xvfb if needed. Linux only.""" | 49 """Stop Xvfb if needed. Linux only.""" |
52 if self._pid: | 50 if self._pid: |
53 try: | 51 try: |
54 os.kill(self._pid, signal.SIGKILL) | 52 os.kill(self._pid, signal.SIGKILL) |
55 except: | 53 except: |
56 pass | 54 pass |
57 del os.environ['DISPLAY'] | 55 del os.environ['DISPLAY'] |
58 self._pid = 0 | 56 self._pid = 0 |
OLD | NEW |