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

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

Issue 23523045: Clean the machine before running commands in the mini_installer test framework. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 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 e0614243b0ee51d3c5219d77e050f43e494f4bb3..a1ca4be38539334ff1b0263b28fae573fcc01220 100644
--- a/chrome/test/mini_installer/test_installer.py
+++ b/chrome/test/mini_installer/test_installer.py
@@ -69,7 +69,7 @@ class InstallerTest(unittest.TestCase):
self.assertEqual(1, len(self._test) % 2,
'The length of test array must be odd')
- # TODO(sukolsak): run a reset command that puts the machine in clean state.
+ self._RunCleanCommand()
state = self._test[0]
self._VerifyState(state)
@@ -118,6 +118,19 @@ class InstallerTest(unittest.TestCase):
self.fail('Command %s returned non-zero exit status %s' % (
resolved_command, exit_status))
+ def _RunCleanCommand(self):
+ """Puts the machine in the clean state (i.e. Chrome not installed)."""
+ # TODO(sukolsak): Read the clean state from the config file and clean
+ # the machine according to it.
robertshield 2013/09/10 20:59:31 Also, consider adding a TODO to handle SxS install
sukolsak 2013/09/10 21:26:29 Done.
+ command = ('python uninstall_chrome.py '
+ '--chrome-long-name="$CHROME_LONG_NAME" & '
robertshield 2013/09/10 20:59:31 Just to double check: it is my understanding that
sukolsak 2013/09/10 21:26:29 They will print an error message to stderr. For ex
+ 'python uninstall_chrome.py '
+ '--chrome-long-name="$CHROME_LONG_NAME" --system-level')
+ resolved_command = self._path_resolver.ResolvePath(command)
+ script_dir = os.path.dirname(os.path.abspath(__file__))
+ subprocess.call(resolved_command, shell=True, cwd=script_dir,
+ stderr=open(os.devnull, 'w'))
+
def MergePropertyDictionaries(current_property, new_property):
"""Merges the new property dictionary into the current property dictionary.
« 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