| OLD | NEW |
| 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 """ |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 variable_expander: A VariableExpander object. | 200 variable_expander: A VariableExpander object. |
| 201 """ | 201 """ |
| 202 # A list of (system_level, product_name, product_switch, registry_subkey) | 202 # A list of (system_level, product_name, product_switch, registry_subkey) |
| 203 # tuples for the possible installed products. | 203 # tuples for the possible installed products. |
| 204 data = [ | 204 data = [ |
| 205 (False, '$CHROME_LONG_NAME', '', | 205 (False, '$CHROME_LONG_NAME', '', |
| 206 '$CHROME_UPDATE_REGISTRY_SUBKEY'), | 206 '$CHROME_UPDATE_REGISTRY_SUBKEY'), |
| 207 (True, '$CHROME_LONG_NAME', '--system-level', | 207 (True, '$CHROME_LONG_NAME', '--system-level', |
| 208 '$CHROME_UPDATE_REGISTRY_SUBKEY'), | 208 '$CHROME_UPDATE_REGISTRY_SUBKEY'), |
| 209 ] | 209 ] |
| 210 if variable_expander.Expand('$BRAND') == 'Google Chrome': | 210 if variable_expander.Expand('$SUPPORTS_SXS') == 'True': |
| 211 data.extend([(False, '$CHROME_LONG_NAME_BETA', '', | 211 data.append((False, '$CHROME_LONG_NAME_SXS', '', |
| 212 '$CHROME_UPDATE_REGISTRY_SUBKEY_BETA'), | 212 '$CHROME_UPDATE_REGISTRY_SUBKEY_SXS')) |
| 213 (True, '$CHROME_LONG_NAME_BETA', '--system-level', | |
| 214 '$CHROME_UPDATE_REGISTRY_SUBKEY_BETA'), | |
| 215 (False, '$CHROME_LONG_NAME_DEV', '', | |
| 216 '$CHROME_UPDATE_REGISTRY_SUBKEY_DEV'), | |
| 217 (True, '$CHROME_LONG_NAME_DEV', '--system-level', | |
| 218 '$CHROME_UPDATE_REGISTRY_SUBKEY_DEV'), | |
| 219 (False, '$CHROME_LONG_NAME_SXS', '', | |
| 220 '$CHROME_UPDATE_REGISTRY_SUBKEY_SXS')]) | |
| 221 | 213 |
| 222 interactive_option = '--interactive' if not force_clean else '' | 214 interactive_option = '--interactive' if not force_clean else '' |
| 223 for system_level, product_name, product_switch, registry_subkey in data: | 215 for system_level, product_name, product_switch, registry_subkey in data: |
| 224 command = ('python uninstall_chrome.py ' | 216 command = ('python uninstall_chrome.py ' |
| 225 '--chrome-long-name="%s" ' | 217 '--chrome-long-name="%s" ' |
| 226 '--no-error-if-absent %s %s' % | 218 '--no-error-if-absent %s %s' % |
| 227 (product_name, product_switch, interactive_option)) | 219 (product_name, product_switch, interactive_option)) |
| 228 try: | 220 try: |
| 229 RunCommand(command, variable_expander) | 221 RunCommand(command, variable_expander) |
| 230 except: | 222 except: |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 trie[path] = value | 442 trie[path] = value |
| 451 return | 443 return |
| 452 directory, rest = path.split(TEST_SEPARATOR, 1) | 444 directory, rest = path.split(TEST_SEPARATOR, 1) |
| 453 if directory not in trie: | 445 if directory not in trie: |
| 454 trie[directory] = {} | 446 trie[directory] = {} |
| 455 _AddPathToTrie(trie[directory], rest, value) | 447 _AddPathToTrie(trie[directory], rest, value) |
| 456 | 448 |
| 457 | 449 |
| 458 if __name__ == '__main__': | 450 if __name__ == '__main__': |
| 459 sys.exit(main()) | 451 sys.exit(main()) |
| OLD | NEW |