summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorfrankf@chromium.org <frankf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-03 22:03:22 +0000
committerfrankf@chromium.org <frankf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-03 22:03:22 +0000
commita4bc50a29ca078c146410423d48e551d714ff56d (patch)
treed5c8a9d6fc21ffe33903e359f294f7cb0c9f3383 /build
parent6677305d8b14031f5443c0ba40f594ab8a39a442 (diff)
downloadchromium_src-a4bc50a29ca078c146410423d48e551d714ff56d.zip
chromium_src-a4bc50a29ca078c146410423d48e551d714ff56d.tar.gz
chromium_src-a4bc50a29ca078c146410423d48e551d714ff56d.tar.bz2
[Android] Make cmdline_file argument to FlagChanger mandatory.
We shouldn't be setting that file for apps with no command line file. BUG=None NOTRY=True Review URL: https://codereview.chromium.org/107113006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/android/pylib/flag_changer.py3
-rw-r--r--build/android/pylib/instrumentation/test_runner.py12
-rw-r--r--build/android/pylib/uiautomator/test_runner.py9
3 files changed, 13 insertions, 11 deletions
diff --git a/build/android/pylib/flag_changer.py b/build/android/pylib/flag_changer.py
index 7e5d091..898037f 100644
--- a/build/android/pylib/flag_changer.py
+++ b/build/android/pylib/flag_changer.py
@@ -17,8 +17,7 @@ class FlagChanger(object):
once the tests have completed.
"""
- def __init__(self, adb,
- cmdline_file=constants.PACKAGE_INFO['chrome'].cmdline_file):
+ def __init__(self, adb, cmdline_file):
"""Initializes the FlagChanger and records the original arguments.
Args:
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
index e87de15..dda8162 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -82,10 +82,10 @@ class TestRunner(base_test_runner.BaseTestRunner):
assert len(cmdline_file) < 2, 'Multiple packages have the same test package'
if len(cmdline_file) and cmdline_file[0]:
self.flags = flag_changer.FlagChanger(self.adb, cmdline_file[0])
+ if additional_flags:
+ self.flags.AddFlags(additional_flags)
else:
- self.flags = flag_changer.FlagChanger(self.adb)
- if additional_flags:
- self.flags.AddFlags(additional_flags)
+ self.flags = None
#override
def InstallTestPackage(self):
@@ -154,11 +154,13 @@ class TestRunner(base_test_runner.BaseTestRunner):
# launch lighttpd with same port at same time.
http_server_ports = self.LaunchTestHttpServer(
os.path.join(constants.DIR_SOURCE_ROOT), self._lighttp_port)
- self.flags.AddFlags(['--disable-fre', '--enable-test-intents'])
+ if self.flags:
+ self.flags.AddFlags(['--disable-fre', '--enable-test-intents'])
def TearDown(self):
"""Cleans up the test harness and saves outstanding data from test run."""
- self.flags.Restore()
+ if self.flags:
+ self.flags.Restore()
super(TestRunner, self).TearDown()
def TestSetup(self, test):
diff --git a/build/android/pylib/uiautomator/test_runner.py b/build/android/pylib/uiautomator/test_runner.py
index edb6dc9..100ba1d 100644
--- a/build/android/pylib/uiautomator/test_runner.py
+++ b/build/android/pylib/uiautomator/test_runner.py
@@ -54,10 +54,11 @@ class TestRunner(instr_test_runner.TestRunner):
#override
def _RunTest(self, test, timeout):
self.adb.ClearApplicationState(self._package)
- if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test):
- self.flags.RemoveFlags(['--disable-fre'])
- else:
- self.flags.AddFlags(['--disable-fre'])
+ if self.flags:
+ if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test):
+ self.flags.RemoveFlags(['--disable-fre'])
+ else:
+ self.flags.AddFlags(['--disable-fre'])
self.adb.StartActivity(self._package,
self._activity,
wait_for_completion=True,