Index: tools/cygprofile/profile_android_startup.py |
diff --git a/tools/cygprofile/profile_android_startup.py b/tools/cygprofile/profile_android_startup.py |
index fae608f1e0f47c54de923d7eb3f5280ed3eccad6..37c9151fe6606369e662c23da1185c2fc36a3a83 100644 |
--- a/tools/cygprofile/profile_android_startup.py |
+++ b/tools/cygprofile/profile_android_startup.py |
@@ -135,11 +135,12 @@ 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) |
+ 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]) |
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']) |
+ '127.0.0.1', 0, 0, None, args) |
ports = self._wpr_server.StartServer()[:-1] |
self._host_http_port = ports[0] |
self._host_https_port = ports[1] |
@@ -149,11 +150,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._host_http_port or not self._host_https_port: |
pasko
2015/04/15 09:59:02
I think it's easier to reason about error cases if
azarchs
2015/04/15 10:54:11
Done.
|
+ 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)], |