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

Unified Diff: mojo/devtools/common/devtoolslib/android_shell.py

Issue 1302493002: Explicitly require rooted device in `mojo_test`. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | mojo/devtools/common/devtoolslib/shell_arguments.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/devtools/common/devtoolslib/android_shell.py
diff --git a/mojo/devtools/common/devtoolslib/android_shell.py b/mojo/devtools/common/devtoolslib/android_shell.py
index c3bed337caeb7a60829fbc45be71c563cdf30a12..a4a7d16db7261e650c0c776564dc35a6655e537b 100644
--- a/mojo/devtools/common/devtoolslib/android_shell.py
+++ b/mojo/devtools/common/devtoolslib/android_shell.py
@@ -199,7 +199,7 @@ class AndroidShell(Shell):
return len(subprocess.check_output(self._adb_command([
'shell', 'pm', 'list', 'packages', _MOJO_SHELL_PACKAGE_NAME]))) > 0
- def check_device(self):
+ def check_device(self, require_root=False):
"""Verifies if the device configuration allows adb to run.
If a target device was indicated in the constructor, it checks that the
@@ -234,6 +234,9 @@ class AndroidShell(Shell):
if not device_list[0].endswith('device'):
return False, 'Connected device is not available.'
+ if require_root and not self._run_adb_as_root():
+ return False, 'Cannot run on an unrooted device.'
+
return True, None
def install_apk(self, shell_apk_path):
« no previous file with comments | « no previous file | mojo/devtools/common/devtoolslib/shell_arguments.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698