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

Unified Diff: build/android/pylib/flag_changer.py

Issue 23467004: [android] Update FlagChanger to work with additional apks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
Index: build/android/pylib/flag_changer.py
diff --git a/build/android/pylib/flag_changer.py b/build/android/pylib/flag_changer.py
index 6eb9f0b3c675f93feb2a827fc1aa31f5a8e1fb48..4656e0ccbf6c87f475264f4cace63a162c14119a 100644
--- a/build/android/pylib/flag_changer.py
+++ b/build/android/pylib/flag_changer.py
@@ -8,9 +8,6 @@ import traceback
import warnings
-# Location where chrome reads command line flags from
-CHROME_COMMAND_FILE = '/data/local/chrome-command-line'
-
class FlagChanger(object):
"""Changes the flags Chrome runs with.
@@ -21,11 +18,12 @@ class FlagChanger(object):
once the tests have completed.
"""
- def __init__(self, android_cmd):
- self._android_cmd = android_cmd
+ def __init__(self, adb, cmdline_file):
frankf 2013/08/27 00:28:09 add docstring
craigdh 2013/08/27 17:26:13 Done.
+ self._adb = adb
+ self._cmdline_file = cmdline_file
# Save the original flags.
- self._orig_line = self._android_cmd.GetFileContents(CHROME_COMMAND_FILE)
+ self._orig_line = self._adb.GetFileContents(self._cmdline_file)
if self._orig_line:
self._orig_line = self._orig_line[0].strip()
@@ -90,11 +88,12 @@ class FlagChanger(object):
logging.info('Current flags: %s', self._current_flags)
if self._current_flags:
- self._android_cmd.SetProtectedFileContents(CHROME_COMMAND_FILE,
- 'chrome ' +
- ' '.join(self._current_flags))
+ # The first command line argument doesn't matter as we are not actually
+ # launching the chrome executable using this command line.
+ self._adb.SetProtectedFileContents(self._cmdline_file,
+ ' '.join(['_'] + self._current_flags))
else:
- self._android_cmd.RunShellCommand('su -c rm ' + CHROME_COMMAND_FILE)
+ self._adb.RunShellCommand('su -c rm ' + self._cmdline_file)
def _TokenizeFlags(self, line):
"""Changes the string containing the command line into a list of flags.

Powered by Google App Engine
This is Rietveld 408576698