diff options
author | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 18:03:39 +0000 |
---|---|---|
committer | bulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-19 18:03:39 +0000 |
commit | 3f7b5ed6de86dfaf241df4a065013c594c8065e3 (patch) | |
tree | ea652559d6994bc1bbd61d2ec11267c346fd97a4 /build | |
parent | b75cb94fa22dd5d2663873337f097bd0c6bc519b (diff) | |
download | chromium_src-3f7b5ed6de86dfaf241df4a065013c594c8065e3.zip chromium_src-3f7b5ed6de86dfaf241df4a065013c594c8065e3.tar.gz chromium_src-3f7b5ed6de86dfaf241df4a065013c594c8065e3.tar.bz2 |
Android: Fix one issue for instrumentation on "user" devices.
We can't enable java asserts / reboot those devices.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com/10809017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147484 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/android/pylib/android_commands.py | 6 | ||||
-rw-r--r-- | build/android/pylib/run_java_tests.py | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py index 5e73117..de211d8 100644 --- a/build/android/pylib/android_commands.py +++ b/build/android/pylib/android_commands.py @@ -219,7 +219,7 @@ class AndroidCommands(object): self._adb.SetTargetSerial(device) # So many users require root that we just always do it. This could # be made more fine grain if necessary. - self._adb.EnableAdbRoot() + self._root_enabled = self._adb.EnableAdbRoot() self._logcat = None self._original_governor = None self._pushed_files = [] @@ -229,6 +229,10 @@ class AndroidCommands(object): """Returns our AdbInterface to avoid us wrapping all its methods.""" return self._adb + def IsRootEnabled(self): + """Returns whether or not _adb.EnabledAdbRoot() has succeeded.""" + return self._root_enabled + def GetDeviceYear(self): """Returns the year information of the date on device""" return self.RunShellCommand('date +%Y')[0] diff --git a/build/android/pylib/run_java_tests.py b/build/android/pylib/run_java_tests.py index 598a56a..ddf38fe 100644 --- a/build/android/pylib/run_java_tests.py +++ b/build/android/pylib/run_java_tests.py @@ -248,8 +248,12 @@ class TestRunner(BaseTestRunner): def SetUp(self): """Sets up the test harness and device before all tests are run.""" super(TestRunner, self).SetUp() - if self.adb.SetJavaAssertsEnabled(enable=True): - self.adb.Reboot(full_reboot=False) + if not self.adb.IsRootEnabled(): + logging.warning('Unable to enable java asserts for %s, non rooted device', + self.device) + else: + if self.adb.SetJavaAssertsEnabled(enable=True): + self.adb.Reboot(full_reboot=False) # We give different default value to launch HTTP server based on shard index # because it may have race condition when multiple processes are trying to |