| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 elif sys.platform == 'darwin': | 134 elif sys.platform == 'darwin': |
| 135 dumps_dir = temp_dir | 135 dumps_dir = temp_dir |
| 136 os.environ['BREAKPAD_DUMP_LOCATION'] = dumps_dir | 136 os.environ['BREAKPAD_DUMP_LOCATION'] = dumps_dir |
| 137 elif sys.platform.startswith('linux'): | 137 elif sys.platform.startswith('linux'): |
| 138 # The "--user-data-dir" option is not effective for the Breakpad | 138 # The "--user-data-dir" option is not effective for the Breakpad |
| 139 # setup in Linux Chromium, because Breakpad is initialized before | 139 # setup in Linux Chromium, because Breakpad is initialized before |
| 140 # "--user-data-dir" is read. So we set HOME to redirect the crash | 140 # "--user-data-dir" is read. So we set HOME to redirect the crash |
| 141 # dumps to a temporary directory. | 141 # dumps to a temporary directory. |
| 142 home_dir = temp_dir | 142 home_dir = temp_dir |
| 143 os.environ['HOME'] = home_dir | 143 os.environ['HOME'] = home_dir |
| 144 # On Linux, we also need to set CHROME_ENABLE_BREAKPAD. | 144 options.enable_crash_reporter = True |
| 145 os.environ['CHROME_ENABLE_BREAKPAD'] = '1' | |
| 146 | 145 |
| 147 result = browser_tester.Run(options.url, options) | 146 result = browser_tester.Run(options.url, options) |
| 148 | 147 |
| 149 # Find crash dump results. | 148 # Find crash dump results. |
| 150 if sys.platform.startswith('linux'): | 149 if sys.platform.startswith('linux'): |
| 151 # Look in "~/.config/*/Crash Reports". This will find crash | 150 # Look in "~/.config/*/Crash Reports". This will find crash |
| 152 # reports under ~/.config/chromium or ~/.config/google-chrome, or | 151 # reports under ~/.config/chromium or ~/.config/google-chrome, or |
| 153 # under other subdirectories in case the branding is changed. | 152 # under other subdirectories in case the branding is changed. |
| 154 dumps_dirs = [os.path.join(path, 'Crash Reports') | 153 dumps_dirs = [os.path.join(path, 'Crash Reports') |
| 155 for path in ListPathsInDir(os.path.join(home_dir, '.config'))] | 154 for path in ListPathsInDir(os.path.join(home_dir, '.config'))] |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 cleanup_funcs = [] | 208 cleanup_funcs = [] |
| 210 try: | 209 try: |
| 211 return Main(cleanup_funcs) | 210 return Main(cleanup_funcs) |
| 212 finally: | 211 finally: |
| 213 for func in cleanup_funcs: | 212 for func in cleanup_funcs: |
| 214 func() | 213 func() |
| 215 | 214 |
| 216 | 215 |
| 217 if __name__ == '__main__': | 216 if __name__ == '__main__': |
| 218 sys.exit(MainWrapper()) | 217 sys.exit(MainWrapper()) |
| OLD | NEW |