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

Side by Side Diff: build/android/pylib/run_java_tests.py

Issue 10933011: [Android] Add support for layering device-located test files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Avoid merging tests on a device Created 8 years, 3 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 | « no previous file | 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 """Runs the Java tests. See more information on run_instrumentation_tests.py.""" 5 """Runs the Java tests. See more information on run_instrumentation_tests.py."""
6 6
7 import fnmatch 7 import fnmatch
8 import logging 8 import logging
9 import os 9 import os
10 import re 10 import re
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 self.tests_iter = (BaseTestSharder.tests_container) 155 self.tests_iter = (BaseTestSharder.tests_container)
156 assert self.tests_iter 156 assert self.tests_iter
157 return self.tests_iter 157 return self.tests_iter
158 158
159 def CopyTestFilesOnce(self): 159 def CopyTestFilesOnce(self):
160 """Pushes the test data files to the device. Installs the apk if opted.""" 160 """Pushes the test data files to the device. Installs the apk if opted."""
161 if TestRunner._DEVICE_HAS_TEST_FILES.get(self.device, False): 161 if TestRunner._DEVICE_HAS_TEST_FILES.get(self.device, False):
162 logging.warning('Already copied test files to device %s, skipping.', 162 logging.warning('Already copied test files to device %s, skipping.',
163 self.device) 163 self.device)
164 return 164 return
165 host_test_files_path = (constants.CHROME_DIR + 165 host_test_files = [
166 '/chrome/test/data/android/device_files') 166 ('android_webview/test/data/device_files', 'webview'),
167 if os.path.exists(host_test_files_path): 167 ('content/test/data/android/device_files', 'content'),
168 self.adb.PushIfNeeded(host_test_files_path, 168 ('chrome/test/data/android/device_files', 'chrome')
169 self.adb.GetExternalStorage() + '/' + 169 ]
170 TestRunner._DEVICE_DATA_DIR) 170 for (host_src, dst_layer) in host_test_files:
171 host_test_files_path = constants.CHROME_DIR + '/' + host_src
172 if os.path.exists(host_test_files_path):
173 self.adb.PushIfNeeded(host_test_files_path,
174 self.adb.GetExternalStorage() + '/' +
175 TestRunner._DEVICE_DATA_DIR + '/' + dst_layer)
171 if self.install_apk: 176 if self.install_apk:
172 for apk in self.apks: 177 for apk in self.apks:
173 self.adb.ManagedInstall(apk.GetApkPath(), 178 self.adb.ManagedInstall(apk.GetApkPath(),
174 package_name=apk.GetPackageName()) 179 package_name=apk.GetPackageName())
175 self.tool.CopyFiles() 180 self.tool.CopyFiles()
176 TestRunner._DEVICE_HAS_TEST_FILES[self.device] = True 181 TestRunner._DEVICE_HAS_TEST_FILES[self.device] = True
177 182
178 def SaveCoverageData(self, test): 183 def SaveCoverageData(self, test):
179 """Saves the Emma coverage data before it's overwritten by the next test. 184 """Saves the Emma coverage data before it's overwritten by the next test.
180 185
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 587
583 logging.info('Will run: %s', str(tests)) 588 logging.info('Will run: %s', str(tests))
584 589
585 if len(attached_devices) > 1 and (coverage or options.wait_for_debugger): 590 if len(attached_devices) > 1 and (coverage or options.wait_for_debugger):
586 logging.warning('Coverage / debugger can not be sharded, ' 591 logging.warning('Coverage / debugger can not be sharded, '
587 'using first available device') 592 'using first available device')
588 attached_devices = attached_devices[:1] 593 attached_devices = attached_devices[:1]
589 sharder = TestSharder(attached_devices, options, tests, apks) 594 sharder = TestSharder(attached_devices, options, tests, apks)
590 test_results = sharder.RunShardedTests() 595 test_results = sharder.RunShardedTests()
591 return test_results 596 return test_results
OLDNEW
« 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