| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 # overriding the former), so reading from HKCR ensures that we get | 114 # overriding the former), so reading from HKCR ensures that we get |
| 115 # the value if it is set in either place. See als comments below. | 115 # the value if it is set in either place. See als comments below. |
| 116 hkey = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, sub_key) | 116 hkey = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, sub_key) |
| 117 args = _winreg.QueryValue(hkey, '').split() | 117 args = _winreg.QueryValue(hkey, '').split() |
| 118 _winreg.CloseKey(hkey) | 118 _winreg.CloseKey(hkey) |
| 119 | 119 |
| 120 # In order to keep multiple checkouts from stepping on each other, w
e simply check that an | 120 # In order to keep multiple checkouts from stepping on each other, w
e simply check that an |
| 121 # existing entry points to a valid path and has the right command li
ne. | 121 # existing entry points to a valid path and has the right command li
ne. |
| 122 if len(args) == 2 and self._filesystem.exists(args[0]) and args[0].e
ndswith('perl.exe') and args[1] == '-wT': | 122 if len(args) == 2 and self._filesystem.exists(args[0]) and args[0].e
ndswith('perl.exe') and args[1] == '-wT': |
| 123 return True | 123 return True |
| 124 except WindowsError, e: | 124 except WindowsError as e: |
| 125 if e.errno != errno.ENOENT: | 125 if e.errno != errno.ENOENT: |
| 126 raise e | 126 raise e |
| 127 # The key simply probably doesn't exist. | 127 # The key simply probably doesn't exist. |
| 128 pass | 128 pass |
| 129 | 129 |
| 130 # Note that we write to HKCU so that we don't need privileged access | 130 # Note that we write to HKCU so that we don't need privileged access |
| 131 # to the registry, and that will get reflected in HKCR when it is read,
above. | 131 # to the registry, and that will get reflected in HKCR when it is read,
above. |
| 132 cmdline = self.path_from_chromium_base('third_party', 'perl', 'perl', 'b
in', 'perl.exe') + ' -wT' | 132 cmdline = self.path_from_chromium_base('third_party', 'perl', 'perl', 'b
in', 'perl.exe') + ' -wT' |
| 133 hkey = _winreg.CreateKeyEx(_winreg.HKEY_CURRENT_USER, 'Software\\Classes
\\' + sub_key, 0, _winreg.KEY_WRITE) | 133 hkey = _winreg.CreateKeyEx(_winreg.HKEY_CURRENT_USER, 'Software\\Classes
\\' + sub_key, 0, _winreg.KEY_WRITE) |
| 134 _winreg.SetValue(hkey, '', _winreg.REG_SZ, cmdline) | 134 _winreg.SetValue(hkey, '', _winreg.REG_SZ, cmdline) |
| 135 _winreg.CloseKey(hkey) | 135 _winreg.CloseKey(hkey) |
| 136 return True | 136 return True |
| 137 | 137 |
| 138 def setup_test_run(self): | 138 def setup_test_run(self): |
| 139 super(WinPort, self).setup_test_run() | 139 super(WinPort, self).setup_test_run() |
| 140 | 140 |
| 141 if not self.get_option('disable_breakpad'): | 141 if not self.get_option('disable_breakpad'): |
| 142 assert not self._crash_service, 'Already running a crash service' | 142 assert not self._crash_service, 'Already running a crash service' |
| 143 if self._crash_service_available == None: | 143 if self._crash_service_available is None: |
| 144 self._crash_service_available = self._check_crash_service_availa
ble() | 144 self._crash_service_available = self._check_crash_service_availa
ble() |
| 145 if not self._crash_service_available: | 145 if not self._crash_service_available: |
| 146 return | 146 return |
| 147 service = crash_service.CrashService(self, self._dump_reader.crash_d
umps_directory()) | 147 service = crash_service.CrashService(self, self._dump_reader.crash_d
umps_directory()) |
| 148 service.start() | 148 service.start() |
| 149 self._crash_service = service | 149 self._crash_service = service |
| 150 | 150 |
| 151 def clean_up_test_run(self): | 151 def clean_up_test_run(self): |
| 152 super(WinPort, self).clean_up_test_run() | 152 super(WinPort, self).clean_up_test_run() |
| 153 | 153 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 return result | 241 return result |
| 242 | 242 |
| 243 def look_for_new_crash_logs(self, crashed_processes, start_time): | 243 def look_for_new_crash_logs(self, crashed_processes, start_time): |
| 244 if self.get_option('disable_breakpad'): | 244 if self.get_option('disable_breakpad'): |
| 245 return None | 245 return None |
| 246 return self._dump_reader.look_for_new_crash_logs(crashed_processes, star
t_time) | 246 return self._dump_reader.look_for_new_crash_logs(crashed_processes, star
t_time) |
| 247 | 247 |
| 248 def clobber_old_port_specific_results(self): | 248 def clobber_old_port_specific_results(self): |
| 249 if not self.get_option('disable_breakpad'): | 249 if not self.get_option('disable_breakpad'): |
| 250 self._dump_reader.clobber_old_results() | 250 self._dump_reader.clobber_old_results() |
| OLD | NEW |