summaryrefslogtreecommitdiffstats
path: root/tools/cygprofile
diff options
context:
space:
mode:
authorazarchs <azarchs@chromium.org>2015-04-15 05:25:44 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-15 12:25:58 +0000
commitccb01814f9dc000b0fec81cffc5e965b5a9c8cd7 (patch)
treefd6db90d940eb5d459cdc27e07225cc13abc58e4 /tools/cygprofile
parenta11355dbeabca4b419b38b958bb592bca104886a (diff)
downloadchromium_src-ccb01814f9dc000b0fec81cffc5e965b5a9c8cd7.zip
chromium_src-ccb01814f9dc000b0fec81cffc5e965b5a9c8cd7.tar.gz
chromium_src-ccb01814f9dc000b0fec81cffc5e965b5a9c8cd7.tar.bz2
Make startup of of WPR components resilient to not starting up previous steps.
This fixes the redness in the orderfile bot due to the WPR server failing to start due to certs not being installed. Review URL: https://codereview.chromium.org/1089163004 Cr-Commit-Position: refs/heads/master@{#325229}
Diffstat (limited to 'tools/cygprofile')
-rw-r--r--tools/cygprofile/profile_android_startup.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/cygprofile/profile_android_startup.py b/tools/cygprofile/profile_android_startup.py
index fae608f..b8c5852 100644
--- a/tools/cygprofile/profile_android_startup.py
+++ b/tools/cygprofile/profile_android_startup.py
@@ -135,12 +135,14 @@ class WprManager(object):
"""Start the WPR server on the host and the forwarder on the device."""
print 'Starting WPR on host...'
_DownloadFromCloudStorage(self._WPR_BUCKET, self._wpr_archive_hash)
- self._wpr_server = webpagereplay.ReplayServer(self._wpr_archive,
- '127.0.0.1', 0, 0, None,
- ['--should_generate_certs',
- '--https_root_ca_cert_path=' + self._wpr_ca_cert_path,
- '--use_closest_match'])
- ports = self._wpr_server.StartServer()[:-1]
+ args = ['--user_closest_match']
+ if self._is_test_ca_installed:
+ args.extend(['--should_generate_certs',
+ '--https_root_ca_cert_path=' + self._wpr_ca_cert_path])
+ wpr_server = webpagereplay.ReplayServer(self._wpr_archive,
+ '127.0.0.1', 0, 0, None, args)
+ ports = wpr_server.StartServer()[:-1]
+ self._wpr_server = wpr_server
self._host_http_port = ports[0]
self._host_https_port = ports[1]
@@ -149,11 +151,15 @@ class WprManager(object):
print 'Stopping WPR on host...'
if self._wpr_server:
self._wpr_server.StopServer()
+ self._wpr_server = None
def _StartForwarder(self):
"""Sets up forwarding of device ports to the host, and configures chrome
to use those ports.
"""
+ if not self._wpr_server:
+ logging.warning('No host WPR server to forward to.')
+ return
print 'Starting device forwarder...'
forwarder.Forwarder.Map([(0, self._host_http_port),
(0, self._host_https_port)],