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

Unified Diff: build/android/pylib/instrumentation/instrumentation_test_instance.py

Issue 2752493002: [android] Add support for passing command-line flags directly. (Closed)
Patch Set: Created 3 years, 9 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/instrumentation/instrumentation_test_instance.py
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py
index 93e3a63380d72855f60dfc0246adb3c5c774e230..f88c314861e27909b46cccb15faa0fb682ffda5d 100644
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -639,20 +639,15 @@ class InstrumentationTestInstance(test_instance.TestInstance):
def _initializeFlagAttributes(self, args):
self._flags = ['--enable-test-intents']
- # TODO(jbudorick): Transition "--device-flags" to "--device-flags-file"
- if hasattr(args, 'device_flags') and args.device_flags:
- with open(args.device_flags) as device_flags_file:
- stripped_lines = (l.strip() for l in device_flags_file)
- self._flags.extend([flag for flag in stripped_lines if flag])
- if hasattr(args, 'device_flags_file') and args.device_flags_file:
+ if args.command_line_flags:
+ self._flags.extend(args.command_line_flags)
+ if args.device_flags_file:
with open(args.device_flags_file) as device_flags_file:
stripped_lines = (l.strip() for l in device_flags_file)
- self._flags.extend([flag for flag in stripped_lines if flag])
- if (hasattr(args, 'strict_mode') and
- args.strict_mode and
- args.strict_mode != 'off'):
+ self._flags.extend(flag for flag in stripped_lines if flag)
+ if args.strict_mode and args.strict_mode != 'off':
self._flags.append('--strict-mode=' + args.strict_mode)
- if hasattr(args, 'regenerate_goldens') and args.regenerate_goldens:
+ if args.regenerate_goldens:
self._flags.append('--regenerate-goldens')
def _initializeDriverAttributes(self):

Powered by Google App Engine
This is Rietveld 408576698