summaryrefslogtreecommitdiffstats
path: root/build/android/pylib
diff options
context:
space:
mode:
authoraberent@chromium.org <aberent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 20:44:20 +0000
committeraberent@chromium.org <aberent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-22 20:44:20 +0000
commitc019c89957a010f0391efec0bc840a39532b5bc3 (patch)
tree732572a388d508dfeed8fd78c3e88cd877d96c13 /build/android/pylib
parentb0a49781439fe05539ba9b5af9d1702b33998569 (diff)
downloadchromium_src-c019c89957a010f0391efec0bc840a39532b5bc3.zip
chromium_src-c019c89957a010f0391efec0bc840a39532b5bc3.tar.gz
chromium_src-c019c89957a010f0391efec0bc840a39532b5bc3.tar.bz2
Specify the test files to be used as an argument to the instrumentation tests
This allows different test sets to use different test data, and in particular allows new test sets, needing new data files, to be written without modifying the core test system. BUG=162395 Review URL: https://chromiumcodereview.appspot.com/11348202 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android/pylib')
-rw-r--r--build/android/pylib/run_java_tests.py11
-rw-r--r--build/android/pylib/test_options_parser.py9
2 files changed, 13 insertions, 7 deletions
diff --git a/build/android/pylib/run_java_tests.py b/build/android/pylib/run_java_tests.py
index 4e61e2d..7b5ea6e 100644
--- a/build/android/pylib/run_java_tests.py
+++ b/build/android/pylib/run_java_tests.py
@@ -118,6 +118,7 @@ class TestRunner(BaseTestRunner):
self.build_type = options.build_type
self.install_apk = options.install_apk
+ self.test_data = options.test_data
self.save_perf_json = options.save_perf_json
self.screenshot_failures = options.screenshot_failures
self.wait_for_debugger = options.wait_for_debugger
@@ -162,12 +163,10 @@ class TestRunner(BaseTestRunner):
logging.warning('Already copied test files to device %s, skipping.',
self.device)
return
- host_test_files = [
- ('android_webview/test/data/device_files', 'webview'),
- ('content/test/data/android/device_files', 'content'),
- ('chrome/test/data/android/device_files', 'chrome')
- ]
- for (host_src, dst_layer) in host_test_files:
+ for dest_host_pair in self.test_data:
+ dst_src = dest_host_pair.split(':',1)
+ dst_layer = dst_src[0]
+ host_src = dst_src[1]
host_test_files_path = constants.CHROME_DIR + '/' + host_src
if os.path.exists(host_test_files_path):
self.adb.PushIfNeeded(host_test_files_path,
diff --git a/build/android/pylib/test_options_parser.py b/build/android/pylib/test_options_parser.py
index 2a7d06a..cfe4c0c 100644
--- a/build/android/pylib/test_options_parser.py
+++ b/build/android/pylib/test_options_parser.py
@@ -137,7 +137,14 @@ def AddInstrumentationOptions(option_parser):
'when test(s) fail.'))
option_parser.add_option('--disable_assertions', action='store_true',
help='Run with java assertions disabled.')
-
+ option_parser.add_option('--test_data', action='append',
+ help=('Each instance defines a directory of test '
+ 'data that should be copied to the target(s) '
+ 'before running the tests. The argument '
+ 'should be of the form <target>:<source>, '
+ '<target> is relative to the device data'
+ 'directory, and <source> is relative to the '
+ 'chromium build directory.'))
def ValidateInstrumentationOptions(option_parser, options, args):
"""Validate options/arguments and populate options with defaults."""