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

Unified Diff: build/android/test_runner.py

Issue 2985013002: [test_runner] support relative paths on argument --shared-prefs-file (Closed)
Patch Set: Created 3 years, 5 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: build/android/test_runner.py
diff --git a/build/android/test_runner.py b/build/android/test_runner.py
index b22607fa4c1b34fc3e94f4bf6fd5755ea12baac1..c02c4466da1f72df8ab35eca5963799f201930ec 100755
--- a/build/android/test_runner.py
+++ b/build/android/test_runner.py
@@ -420,7 +420,7 @@ def AddInstrumentationTestOptions(parser):
help='Capture screenshots of test failures')
parser.add_argument(
'--shared-prefs-file',
- dest='shared_prefs_file', type=os.path.realpath,
+ dest='shared_prefs_file', type=os.path.abspath,
shenghuazhang 2017/07/25 20:44:45 Type realpath changes value "//home/..." to "/home
jbudorick 2017/07/25 21:07:46 I think you're on the right track here, but you ca
shenghuazhang 2017/07/25 21:28:10 Thanks for this suggestion! This should be much mo
help='The relative path to a file containing JSON list of shared '
'preference files to edit and how to do so. Example list: '
'[{'
@@ -967,6 +967,13 @@ def main():
parser.error('--replace-system-package and --enable-concurrent-adb cannot '
'be used together')
+ if hasattr(args, 'shared_prefs_file') and args.shared_prefs_file:
+ if args.shared_prefs_file.startswith('//'):
+ args.shared_prefs_file = os.path.abspath(
+ os.path.join(host_paths.DIR_SOURCE_ROOT,
+ args.shared_prefs_file[2:].replace('/', os.sep)))
+ args.shared_prefs_file = os.path.realpath(args.shared_prefs_file)
+
try:
return RunTestsCommand(args)
except base_error.BaseError as e:
« 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