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

Unified Diff: build/android/pylib/host_driven/test_case.py

Issue 159853010: [Android] Lint pylib/host_driven. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/host_driven/setup.py ('k') | build/android/pylib/host_driven/test_info_collection.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/host_driven/test_case.py
diff --git a/build/android/pylib/host_driven/test_case.py b/build/android/pylib/host_driven/test_case.py
index 8ff94083a395f7595357c96029838a39a99c74d9..3ee4fe7a9bfc841c2705f7262a07203792b10163 100644
--- a/build/android/pylib/host_driven/test_case.py
+++ b/build/android/pylib/host_driven/test_case.py
@@ -25,7 +25,6 @@ import os
import time
from pylib import android_commands
-from pylib import constants
from pylib import forwarder
from pylib import valgrind_tools
from pylib.base import base_test_result
@@ -49,21 +48,28 @@ class HostDrivenTestCase(object):
test_name: The name of the method to run as the test.
instrumentation_options: An InstrumentationOptions object.
"""
- self.test_name = test_name
class_name = self.__class__.__name__
- self.qualified_name = '%s.%s' % (class_name, self.test_name)
+ self.adb = None
+ self.cleanup_test_files = False
+ self.device_id = ''
+ self.has_forwarded_ports = False
+ self.instrumentation_options = instrumentation_options
+ self.ports_to_forward = []
+ self.push_deps = False
+ self.shard_index = 0
+
# Use tagged_name when creating results, so that we can identify host-driven
# tests in the overall results.
+ self.test_name = test_name
+ self.qualified_name = '%s.%s' % (class_name, self.test_name)
self.tagged_name = '%s_%s' % (self._HOST_DRIVEN_TAG, self.qualified_name)
- self.instrumentation_options = instrumentation_options
- self.ports_to_forward = []
- self.has_forwarded_ports = False
-
# TODO(bulach): make ports_to_forward not optional and move the Forwarder
# mapping here.
def SetUp(self, device, shard_index, push_deps,
- cleanup_test_files, ports_to_forward=[]):
+ 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.adb = android_commands.AndroidCommands(self.device_id)
@@ -85,7 +91,8 @@ class HostDrivenTestCase(object):
# Get the test method on the derived class and execute it
return getattr(self, self.test_name)()
- def __GetHostForwarderLog(self):
+ @staticmethod
+ def __GetHostForwarderLog():
return ('-- Begin Full HostForwarder log\n'
'%s\n'
'--End Full HostForwarder log\n' % forwarder.Forwarder.GetHostLog())
« no previous file with comments | « build/android/pylib/host_driven/setup.py ('k') | build/android/pylib/host_driven/test_info_collection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698