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

Side by Side Diff: build/android/pylib/utils/test_options_parser.py

Issue 12096018: Add --keep_data as option to adb_install_apk (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/adb_install_apk.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Parses options for the instrumentation tests.""" 5 """Parses options for the instrumentation tests."""
6 6
7 #TODO(craigdh): pylib/utils/ should not depend on pylib/. 7 #TODO(craigdh): pylib/utils/ should not depend on pylib/.
8 from pylib import constants 8 from pylib import constants
9 9
10 import optparse 10 import optparse
(...skipping 19 matching lines...) Expand all
30 30
31 def AddInstallAPKOption(option_parser): 31 def AddInstallAPKOption(option_parser):
32 """Decorates OptionParser with apk option used to install the APK.""" 32 """Decorates OptionParser with apk option used to install the APK."""
33 AddBuildTypeOption(option_parser) 33 AddBuildTypeOption(option_parser)
34 option_parser.add_option('--apk', 34 option_parser.add_option('--apk',
35 help=('The name of the apk containing the ' 35 help=('The name of the apk containing the '
36 ' application (with the .apk extension).')) 36 ' application (with the .apk extension).'))
37 option_parser.add_option('--apk_package', 37 option_parser.add_option('--apk_package',
38 help=('The package name used by the apk containing ' 38 help=('The package name used by the apk containing '
39 'the application.')) 39 'the application.'))
40 option_parser.add_option('--keep_data',
41 action='store_true',
42 default=False,
43 help=('Keep the package data when installing '
44 'the application.'))
40 45
41 46
42 def ValidateInstallAPKOption(option_parser, options): 47 def ValidateInstallAPKOption(option_parser, options):
43 if not options.apk: 48 if not options.apk:
44 option_parser.error('--apk is mandatory.') 49 option_parser.error('--apk is mandatory.')
45 if not os.path.exists(options.apk): 50 if not os.path.exists(options.apk):
46 options.apk = os.path.join(constants.CHROME_DIR, 51 options.apk = os.path.join(constants.CHROME_DIR,
47 'out', options.build_type, 52 'out', options.build_type,
48 'apks', options.apk) 53 'apks', options.apk)
49 54
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 '%s.apk' % options.test_apk) 227 '%s.apk' % options.test_apk)
223 options.test_apk_jar_path = os.path.join( 228 options.test_apk_jar_path = os.path.join(
224 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR, 229 _SDK_OUT_DIR, options.build_type, constants.SDK_BUILD_TEST_JAVALIB_DIR,
225 '%s.jar' % options.test_apk) 230 '%s.jar' % options.test_apk)
226 if options.annotation_str: 231 if options.annotation_str:
227 options.annotation = options.annotation_str.split() 232 options.annotation = options.annotation_str.split()
228 elif options.test_filter: 233 elif options.test_filter:
229 options.annotation = [] 234 options.annotation = []
230 else: 235 else:
231 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest'] 236 options.annotation = ['Smoke', 'SmallTest', 'MediumTest', 'LargeTest']
OLDNEW
« no previous file with comments | « build/android/adb_install_apk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698