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

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

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « build/android/pylib/instrumentation/test_options.py ('k') | build/android/pylib/linker/setup.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/test_runner.py
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
index f2808da8560a15e230002fa2116b4a7a8eaaf965..92d80f97f145362d66272433be5a3ccbfd0b0932 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -27,32 +27,13 @@ import perf_tests_results_helper # pylint: disable=F0401
_PERF_TEST_ANNOTATION = 'PerfTest'
-def _GetDataFilesForTestSuite(suite_basename):
- """Returns a list of data files/dirs needed by the test suite.
-
- Args:
- suite_basename: The test suite basename for which to return file paths.
-
- Returns:
- A list of test file and directory paths.
- """
- test_files = []
- if suite_basename in ['ChromeTest', 'ContentShellTest']:
- test_files += [
- 'net/data/ssl/certificates/',
- ]
- return test_files
-
-
class TestRunner(base_test_runner.BaseTestRunner):
"""Responsible for running a series of tests connected to a single device."""
- _DEVICE_DATA_DIR = 'chrome/test/data'
_DEVICE_COVERAGE_DIR = 'chrome/test/coverage'
_HOSTMACHINE_PERF_OUTPUT_FILE = '/tmp/chrome-profile'
_DEVICE_PERF_OUTPUT_SEARCH_PREFIX = (constants.DEVICE_PERF_OUTPUT_DIR +
'/chrome-profile*')
- _DEVICE_HAS_TEST_FILES = {}
def __init__(self, test_options, device, shard_index, test_pkg,
additional_flags=None):
@@ -89,45 +70,6 @@ class TestRunner(base_test_runner.BaseTestRunner):
def InstallTestPackage(self):
self.test_pkg.Install(self.device)
- #override
- def PushDataDeps(self):
- # TODO(frankf): Implement a general approach for copying/installing
- # once across test runners.
- if TestRunner._DEVICE_HAS_TEST_FILES.get(self.device, False):
- logging.warning('Already copied test files to device %s, skipping.',
- str(self.device))
- return
-
- host_device_file_tuples = []
- test_data = _GetDataFilesForTestSuite(self.test_pkg.GetApkName())
- if test_data:
- # Make sure SD card is ready.
- self.device.WaitUntilFullyBooted(timeout=20)
- host_device_file_tuples += [
- (os.path.join(constants.DIR_SOURCE_ROOT, p),
- os.path.join(self.device.GetExternalStoragePath(), p))
- for p in test_data]
-
- # TODO(frankf): Specify test data in this file as opposed to passing
- # as command-line.
- for dest_host_pair in self.options.test_data:
- dst_src = dest_host_pair.split(':', 1)
- dst_layer = dst_src[0]
- host_src = dst_src[1]
- host_test_files_path = os.path.join(constants.DIR_SOURCE_ROOT,
- host_src)
- if os.path.exists(host_test_files_path):
- host_device_file_tuples += [(
- host_test_files_path,
- '%s/%s/%s' % (
- self.device.GetExternalStoragePath(),
- TestRunner._DEVICE_DATA_DIR,
- dst_layer))]
- if host_device_file_tuples:
- self.device.PushChangedFiles(host_device_file_tuples)
- self.tool.CopyFiles(self.device)
- TestRunner._DEVICE_HAS_TEST_FILES[str(self.device)] = True
-
def _GetInstrumentationArgs(self):
ret = {}
if self.options.wait_for_debugger:
@@ -209,7 +151,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
Whether the feature being tested is FirstRunExperience.
"""
annotations = self.test_pkg.GetTestAnnotations(test)
- return ('FirstRunExperience' == annotations.get('Feature', None))
+ return 'FirstRunExperience' == annotations.get('Feature', None)
def _IsPerfTest(self, test):
"""Determines whether a test is a performance test.
@@ -276,7 +218,8 @@ class TestRunner(base_test_runner.BaseTestRunner):
# Wait and grab annotation data so we can figure out which traces to parse
regex = self.device.old_interface.WaitForLogMatch(
- re.compile('\*\*PERFANNOTATION\(' + raw_test_name + '\)\:(.*)'), None)
+ re.compile(r'\*\*PERFANNOTATION\(' + raw_test_name + r'\)\:(.*)'),
+ None)
# If the test is set to run on a specific device type only (IE: only
# tablet or phone) and it is being run on the wrong device, the test
« no previous file with comments | « build/android/pylib/instrumentation/test_options.py ('k') | build/android/pylib/linker/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698