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

Unified Diff: chrome/test/mini_installer/test_installer.py

Issue 959823002: test_installer: fix RunCleanCommand for SxS installs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for Chromium-branded builds where SxS isn't supported Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/mini_installer/test_installer.py
diff --git a/chrome/test/mini_installer/test_installer.py b/chrome/test/mini_installer/test_installer.py
index 2b5c870b9076ed11fa8c0f21348e4bfce71606e0..723459b28a9d3e00dd1eaa4d6d91c62a03950127 100644
--- a/chrome/test/mini_installer/test_installer.py
+++ b/chrome/test/mini_installer/test_installer.py
@@ -168,16 +168,18 @@ def RunCommand(command, variable_expander):
expanded_command, exit_status))
-def DeleteGoogleUpdateRegistration(system_level, variable_expander):
+def DeleteGoogleUpdateRegistration(system_level, registry_subkey,
+ variable_expander):
"""Deletes Chrome's registration with Google Update.
Args:
system_level: True if system-level Chrome is to be deleted.
+ registry_subkey: The pre-expansion registry subkey for the product.
variable_expander: A VariableExpander object.
"""
root = (_winreg.HKEY_LOCAL_MACHINE if system_level
else _winreg.HKEY_CURRENT_USER)
- key_name = variable_expander.Expand('$CHROME_UPDATE_REGISTRY_SUBKEY')
+ key_name = variable_expander.Expand(registry_subkey)
try:
key_handle = _winreg.OpenKey(root, key_name, 0,
_winreg.KEY_SET_VALUE |
@@ -196,17 +198,28 @@ def RunCleanCommand(force_clean, variable_expander):
installations.
variable_expander: A VariableExpander object.
"""
- # TODO(sukolsak): Handle Chrome SxS installs.
+ # A list of (system_level, product_name, product_switch, registry_subkey)
+ # tuples for the possible installed products.
+ data = [
+ (False, '$CHROME_LONG_NAME', '',
+ '$CHROME_UPDATE_REGISTRY_SUBKEY'),
+ (True, '$CHROME_LONG_NAME', '--system-level',
+ '$CHROME_UPDATE_REGISTRY_SUBKEY'),
+ ]
+ if variable_expander.Expand('$SUPPORTS_SXS') == 'True':
+ data.append((False, '$CHROME_LONG_NAME_SXS', '',
+ '$CHROME_UPDATE_REGISTRY_SUBKEY_SXS'))
+
interactive_option = '--interactive' if not force_clean else ''
- for system_level in (False, True):
- level_option = '--system-level' if system_level else ''
+ for system_level, product_name, product_switch, registry_subkey in data:
command = ('python uninstall_chrome.py '
- '--chrome-long-name="$CHROME_LONG_NAME" '
+ '--chrome-long-name="%s" '
'--no-error-if-absent %s %s' %
- (level_option, interactive_option))
+ (product_name, product_switch, interactive_option))
RunCommand(command, variable_expander)
if force_clean:
- DeleteGoogleUpdateRegistration(system_level, variable_expander)
+ DeleteGoogleUpdateRegistration(system_level, registry_subkey,
+ variable_expander)
def MergePropertyDictionaries(current_property, new_property):
« 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