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 |
5 import os | 7 import os |
6 import signal | 8 import signal |
7 import subprocess | 9 import subprocess |
8 import sys | 10 import sys |
9 import time | 11 import time |
10 | 12 |
11 | 13 |
12 def _IsLinux(): | 14 def _IsLinux(): |
13 """Return True if on Linux; else False.""" | 15 """Return True if on Linux; else False.""" |
14 return sys.platform.startswith('linux') | 16 return sys.platform.startswith('linux') |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 49 |
48 def Stop(self): | 50 def Stop(self): |
49 """Stop Xvfb if needed. Linux only.""" | 51 """Stop Xvfb if needed. Linux only.""" |
50 if self._pid: | 52 if self._pid: |
51 try: | 53 try: |
52 os.kill(self._pid, signal.SIGKILL) | 54 os.kill(self._pid, signal.SIGKILL) |
53 except: | 55 except: |
54 pass | 56 pass |
55 del os.environ['DISPLAY'] | 57 del os.environ['DISPLAY'] |
56 self._pid = 0 | 58 self._pid = 0 |
OLD | NEW |