Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: chrome/test/mini_installer/test_installer.py

Issue 1997173002: Swallow exceptions from running Chrome's uninstaller in RunCleanCommand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 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 """This script tests the installer with test cases specified in the config file. 5 """This script tests the installer with test cases specified in the config file.
6 6
7 For each test case, it checks that the machine states after the execution of 7 For each test case, it checks that the machine states after the execution of
8 each command match the expected machine states. For more details, take a look at 8 each command match the expected machine states. For more details, take a look at
9 the design documentation at http://goo.gl/Q0rGM6 9 the design documentation at http://goo.gl/Q0rGM6
10 """ 10 """
11 11
12 import argparse 12 import argparse
13 import datetime 13 import datetime
14 import inspect 14 import inspect
15 import json 15 import json
16 import os 16 import os
17 import subprocess 17 import subprocess
18 import sys 18 import sys
19 import time 19 import time
20 import traceback
20 import unittest 21 import unittest
21 import _winreg 22 import _winreg
22 23
23 from variable_expander import VariableExpander 24 from variable_expander import VariableExpander
24 import verifier_runner 25 import verifier_runner
25 26
26 27
27 def LogMessage(message): 28 def LogMessage(message):
28 """Logs a message to stderr. 29 """Logs a message to stderr.
29 30
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if variable_expander.Expand('$SUPPORTS_SXS') == 'True': 210 if variable_expander.Expand('$SUPPORTS_SXS') == 'True':
210 data.append((False, '$CHROME_LONG_NAME_SXS', '', 211 data.append((False, '$CHROME_LONG_NAME_SXS', '',
211 '$CHROME_UPDATE_REGISTRY_SUBKEY_SXS')) 212 '$CHROME_UPDATE_REGISTRY_SUBKEY_SXS'))
212 213
213 interactive_option = '--interactive' if not force_clean else '' 214 interactive_option = '--interactive' if not force_clean else ''
214 for system_level, product_name, product_switch, registry_subkey in data: 215 for system_level, product_name, product_switch, registry_subkey in data:
215 command = ('python uninstall_chrome.py ' 216 command = ('python uninstall_chrome.py '
216 '--chrome-long-name="%s" ' 217 '--chrome-long-name="%s" '
217 '--no-error-if-absent %s %s' % 218 '--no-error-if-absent %s %s' %
218 (product_name, product_switch, interactive_option)) 219 (product_name, product_switch, interactive_option))
219 RunCommand(command, variable_expander) 220 try:
221 RunCommand(command, variable_expander)
222 except:
csharp 2016/05/24 14:56:04 Is it possible to be more specific about what you
223 message = traceback.format_exception(*sys.exc_info())
224 message.insert(0, 'Error cleaning up an old install with:\n')
225 LogMessage(''.join(message))
220 if force_clean: 226 if force_clean:
221 DeleteGoogleUpdateRegistration(system_level, registry_subkey, 227 DeleteGoogleUpdateRegistration(system_level, registry_subkey,
222 variable_expander) 228 variable_expander)
223 229
224 230
225 def MergePropertyDictionaries(current_property, new_property): 231 def MergePropertyDictionaries(current_property, new_property):
226 """Merges the new property dictionary into the current property dictionary. 232 """Merges the new property dictionary into the current property dictionary.
227 233
228 This is different from general dictionary merging in that, in case there are 234 This is different from general dictionary merging in that, in case there are
229 keys with the same name, we merge values together in the first level, and we 235 keys with the same name, we merge values together in the first level, and we
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 trie[path] = value 439 trie[path] = value
434 return 440 return
435 directory, rest = path.split(TEST_SEPARATOR, 1) 441 directory, rest = path.split(TEST_SEPARATOR, 1)
436 if directory not in trie: 442 if directory not in trie:
437 trie[directory] = {} 443 trie[directory] = {}
438 _AddPathToTrie(trie[directory], rest, value) 444 _AddPathToTrie(trie[directory], rest, value)
439 445
440 446
441 if __name__ == '__main__': 447 if __name__ == '__main__':
442 sys.exit(main()) 448 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698