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

Unified Diff: build/android/pylib/chrome_test_server_spawner.py

Issue 22933005: [android] Make build_type a singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix call to _LogToFile Created 7 years, 4 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
Index: build/android/pylib/chrome_test_server_spawner.py
diff --git a/build/android/pylib/chrome_test_server_spawner.py b/build/android/pylib/chrome_test_server_spawner.py
index 0ff79973593c4409dd55be4e3cdc8983c73b8b3f..b15f2917b1f78bfc3f10f53f8b474c4e8c102647 100644
--- a/build/android/pylib/chrome_test_server_spawner.py
+++ b/build/android/pylib/chrome_test_server_spawner.py
@@ -100,7 +100,7 @@ def _GetServerTypeCommandLine(server_type):
class TestServerThread(threading.Thread):
"""A thread to run the test server in a separate process."""
- def __init__(self, ready_event, arguments, adb, tool, build_type):
+ def __init__(self, ready_event, arguments, adb, tool):
"""Initialize TestServerThread with the following argument.
Args:
@@ -108,7 +108,6 @@ class TestServerThread(threading.Thread):
arguments: dictionary of arguments to run the test server.
adb: instance of AndroidCommands.
tool: instance of runtime error detection tool.
- build_type: 'Release' or 'Debug'.
"""
threading.Thread.__init__(self)
self.wait_event = threading.Event()
@@ -128,7 +127,6 @@ class TestServerThread(threading.Thread):
self.pipe_in = None
self.pipe_out = None
self.command_line = []
- self.build_type = build_type
def _WaitToStartAndGetPortFromTestServer(self):
"""Waits for the Python test server to start and gets the port it is using.
@@ -251,7 +249,8 @@ class TestServerThread(threading.Thread):
else:
self.is_ready = _CheckPortStatus(self.host_port, True)
if self.is_ready:
- Forwarder.Map([(0, self.host_port)], self.adb, self.build_type, self.tool)
+ Forwarder.Map([(0, self.host_port)], self.adb, constants.GetBuildType(),
+ self.tool)
# Check whether the forwarder is ready on the device.
self.is_ready = False
device_port = Forwarder.DevicePortForHostPort(self.host_port)
@@ -333,8 +332,7 @@ class SpawningServerRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
ready_event,
json.loads(test_server_argument_json),
self.server.adb,
- self.server.tool,
- self.server.build_type)
+ self.server.tool)
self.server.test_server_instance.setDaemon(True)
self.server.test_server_instance.start()
ready_event.wait()
@@ -401,14 +399,14 @@ class SpawningServerRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
class SpawningServer(object):
"""The class used to start/stop a http server."""
- def __init__(self, test_server_spawner_port, adb, tool, build_type):
+ def __init__(self, test_server_spawner_port, adb, tool):
logging.info('Creating new spawner on port: %d.', test_server_spawner_port)
self.server = BaseHTTPServer.HTTPServer(('', test_server_spawner_port),
SpawningServerRequestHandler)
self.server.adb = adb
self.server.tool = tool
self.server.test_server_instance = None
- self.server.build_type = build_type
+ self.server.build_type = constants.GetBuildType()
def _Listen(self):
logging.info('Starting test server spawner')

Powered by Google App Engine
This is Rietveld 408576698