summaryrefslogtreecommitdiffstats
path: root/build/android/pylib/host_driven
diff options
context:
space:
mode:
authorJohn Budorick <jbudorick@chromium.org>2015-04-02 15:53:31 -0700
committerJohn Budorick <jbudorick@chromium.org>2015-04-02 22:54:51 +0000
commitbd6b7ec8c71da55fc79039374af97f77e5b2051b (patch)
tree7dd92c796d6daa7b06117c314c8c7f9bdf016a95 /build/android/pylib/host_driven
parent81d4867666467192685ae572de885796fe79c39a (diff)
downloadchromium_src-bd6b7ec8c71da55fc79039374af97f77e5b2051b.zip
chromium_src-bd6b7ec8c71da55fc79039374af97f77e5b2051b.tar.gz
chromium_src-bd6b7ec8c71da55fc79039374af97f77e5b2051b.tar.bz2
Revert of [Android] Reland cleanup of old_interface in build/android/pylib. (patchset #2 id:20001 of https://codereview.chromium.org/1050883002/)
Reason for revert: Broke the perf bots again. Original issue's description: > [Android] Reland cleanup of old_interface in build/android/pylib. > > Original CL: https://codereview.chromium.org/1047703002/ > > BUG=267773 TBR=klundberg@chromium.org,perezju@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=267773 Review URL: https://codereview.chromium.org/1059443005 Cr-Commit-Position: refs/heads/master@{#323573}
Diffstat (limited to 'build/android/pylib/host_driven')
-rw-r--r--build/android/pylib/host_driven/setup.py3
-rw-r--r--build/android/pylib/host_driven/test_case.py7
-rw-r--r--build/android/pylib/host_driven/test_runner.py12
3 files changed, 12 insertions, 10 deletions
diff --git a/build/android/pylib/host_driven/setup.py b/build/android/pylib/host_driven/setup.py
index b2ed348..285bcd4 100644
--- a/build/android/pylib/host_driven/setup.py
+++ b/build/android/pylib/host_driven/setup.py
@@ -195,6 +195,7 @@ def InstrumentationSetup(host_driven_test_root, official_build,
def TestRunnerFactory(device, shard_index):
return test_runner.HostDrivenTestRunner(
device, shard_index,
- instrumentation_options.tool)
+ instrumentation_options.tool,
+ instrumentation_options.cleanup_test_files)
return (TestRunnerFactory, available_tests)
diff --git a/build/android/pylib/host_driven/test_case.py b/build/android/pylib/host_driven/test_case.py
index a7c6a18..8c372cd 100644
--- a/build/android/pylib/host_driven/test_case.py
+++ b/build/android/pylib/host_driven/test_case.py
@@ -50,6 +50,8 @@ class HostDrivenTestCase(object):
instrumentation_options: An InstrumentationOptions object.
"""
class_name = self.__class__.__name__
+ self.adb = None
+ self.cleanup_test_files = False
self.device = None
self.device_id = ''
self.has_forwarded_ports = False
@@ -65,12 +67,15 @@ class HostDrivenTestCase(object):
# TODO(bulach): make ports_to_forward not optional and move the Forwarder
# mapping here.
- def SetUp(self, device, shard_index, ports_to_forward=None):
+ def SetUp(self, device, shard_index,
+ cleanup_test_files, ports_to_forward=None):
if not ports_to_forward:
ports_to_forward = []
self.device_id = device
self.shard_index = shard_index
self.device = device_utils.DeviceUtils(self.device_id)
+ self.adb = self.device.old_interface
+ self.cleanup_test_files = cleanup_test_files
if ports_to_forward:
self.ports_to_forward = ports_to_forward
diff --git a/build/android/pylib/host_driven/test_runner.py b/build/android/pylib/host_driven/test_runner.py
index 5e175bc..865be20 100644
--- a/build/android/pylib/host_driven/test_runner.py
+++ b/build/android/pylib/host_driven/test_runner.py
@@ -47,27 +47,23 @@ class HostDrivenTestRunner(base_test_runner.BaseTestRunner):
result, rather than being re-raised on the main thread.
"""
- # TODO(jbudorick): Remove cleanup_test_files once it's no longer used.
- # pylint: disable=unused-argument
#override
- def __init__(self, device, shard_index, tool, cleanup_test_files=None):
+ def __init__(self, device, shard_index, tool, cleanup_test_files):
"""Creates a new HostDrivenTestRunner.
Args:
device: Attached android device.
shard_index: Shard index.
tool: Name of the Valgrind tool.
- cleanup_test_files: Deprecated.
+ cleanup_test_files: Whether or not to cleanup test files on device.
"""
- super(HostDrivenTestRunner, self).__init__(device, tool)
+ super(HostDrivenTestRunner, self).__init__(device, tool, cleanup_test_files)
# The shard index affords the ability to create unique port numbers (e.g.
# DEFAULT_PORT + shard_index) if the test so wishes.
self.shard_index = shard_index
- # pylint: enable=unused-argument
-
#override
def RunTest(self, test):
"""Sets up and runs a test case.
@@ -86,7 +82,7 @@ class HostDrivenTestRunner(base_test_runner.BaseTestRunner):
exception_raised = False
try:
- test.SetUp(str(self.device), self.shard_index)
+ test.SetUp(str(self.device), self.shard_index, self._cleanup_test_files)
except Exception:
logging.exception(
'Caught exception while trying to run SetUp() for test: ' +