| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import subprocess | 7 import subprocess |
| 8 import sys | 8 import sys |
| 9 import tempfile | 9 import tempfile |
| 10 import time | 10 import time |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 dump_info[key] = value | 35 dump_info[key] = value |
| 36 fh.close() | 36 fh.close() |
| 37 return dump_info | 37 return dump_info |
| 38 | 38 |
| 39 | 39 |
| 40 def StartCrashService(browser_path, dumps_dir, windows_pipe_name, | 40 def StartCrashService(browser_path, dumps_dir, windows_pipe_name, |
| 41 cleanup_funcs, crash_service_exe): | 41 cleanup_funcs, crash_service_exe): |
| 42 # Find crash_service.exe relative to chrome.exe. This is a bit icky. | 42 # Find crash_service.exe relative to chrome.exe. This is a bit icky. |
| 43 browser_dir = os.path.dirname(browser_path) | 43 browser_dir = os.path.dirname(browser_path) |
| 44 proc = subprocess.Popen([os.path.join(browser_dir, crash_service_exe), | 44 proc = subprocess.Popen([os.path.join(browser_dir, crash_service_exe), |
| 45 '--v=1', # Verbose output for debugging failures |
| 45 '--dumps-dir=%s' % dumps_dir, | 46 '--dumps-dir=%s' % dumps_dir, |
| 46 '--pipe-name=%s' % windows_pipe_name]) | 47 '--pipe-name=%s' % windows_pipe_name]) |
| 47 | 48 |
| 48 def Cleanup(): | 49 def Cleanup(): |
| 49 # Note that if the process has already exited, this will raise | 50 # Note that if the process has already exited, this will raise |
| 50 # an 'Access is denied' WindowsError exception, but | 51 # an 'Access is denied' WindowsError exception, but |
| 51 # crash_service.exe is not supposed to do this and such | 52 # crash_service.exe is not supposed to do this and such |
| 52 # behaviour should make the test fail. | 53 # behaviour should make the test fail. |
| 53 proc.terminate() | 54 proc.terminate() |
| 54 status = proc.wait() | 55 status = proc.wait() |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 cleanup_funcs = [] | 209 cleanup_funcs = [] |
| 209 try: | 210 try: |
| 210 return Main(cleanup_funcs) | 211 return Main(cleanup_funcs) |
| 211 finally: | 212 finally: |
| 212 for func in cleanup_funcs: | 213 for func in cleanup_funcs: |
| 213 func() | 214 func() |
| 214 | 215 |
| 215 | 216 |
| 216 if __name__ == '__main__': | 217 if __name__ == '__main__': |
| 217 sys.exit(MainWrapper()) | 218 sys.exit(MainWrapper()) |
| OLD | NEW |