| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import logging | 5 import logging |
| 6 import pprint | 6 import pprint |
| 7 import shlex | 7 import shlex |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from telemetry.core import exceptions | 10 from telemetry.core import exceptions |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 self.browser_options.VERBOSE_LOGGING): | 118 self.browser_options.VERBOSE_LOGGING): |
| 119 args.extend(['--enable-logging', '--v=1']) | 119 args.extend(['--enable-logging', '--v=1']) |
| 120 | 120 |
| 121 return args | 121 return args |
| 122 | 122 |
| 123 def GetReplayBrowserStartupArgs(self): | 123 def GetReplayBrowserStartupArgs(self): |
| 124 replay_args = [] | 124 replay_args = [] |
| 125 network_backend = self.platform_backend.network_controller_backend | 125 network_backend = self.platform_backend.network_controller_backend |
| 126 if not network_backend.is_initialized: | 126 if not network_backend.is_initialized: |
| 127 return [] | 127 return [] |
| 128 proxy_port = network_backend.forwarder.port_pair.remote_port | |
| 129 replay_args.append('--proxy-server=socks://localhost:%s' % proxy_port) | |
| 130 if not network_backend.is_test_ca_installed: | 128 if not network_backend.is_test_ca_installed: |
| 131 # Ignore certificate errors if the platform backend has not created | 129 # Ignore certificate errors if the platform backend has not created |
| 132 # and installed a root certificate. | 130 # and installed a root certificate. |
| 133 replay_args.append('--ignore-certificate-errors') | 131 replay_args.append('--ignore-certificate-errors') |
| 132 |
| 133 replay_args.append('--host-resolver-rules=MAP * %s,EXCLUDE localhost' % |
| 134 network_backend.host_ip) |
| 135 http = network_backend._wpr_http.remote_port |
| 136 https = network_backend._wpr_https.remote_port |
| 137 replay_args.append('--testing-fixed-http-port=%s' % http) |
| 138 replay_args.append('--testing-fixed-https-port=%s' % https) |
| 134 return replay_args | 139 return replay_args |
| 135 | 140 |
| 136 def HasBrowserFinishedLaunching(self): | 141 def HasBrowserFinishedLaunching(self): |
| 137 assert self._port, 'No DevTools port info available.' | 142 assert self._port, 'No DevTools port info available.' |
| 138 return devtools_client_backend.IsDevToolsAgentAvailable(self._port, self) | 143 return devtools_client_backend.IsDevToolsAgentAvailable(self._port, self) |
| 139 | 144 |
| 140 def _InitDevtoolsClientBackend(self, remote_devtools_port=None): | 145 def _InitDevtoolsClientBackend(self, remote_devtools_port=None): |
| 141 """ Initiate the devtool client backend which allow browser connection | 146 """ Initiate the devtool client backend which allow browser connection |
| 142 through browser' devtool. | 147 through browser' devtool. |
| 143 | 148 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 def supports_cpu_metrics(self): | 305 def supports_cpu_metrics(self): |
| 301 return True | 306 return True |
| 302 | 307 |
| 303 @property | 308 @property |
| 304 def supports_memory_metrics(self): | 309 def supports_memory_metrics(self): |
| 305 return True | 310 return True |
| 306 | 311 |
| 307 @property | 312 @property |
| 308 def supports_power_metrics(self): | 313 def supports_power_metrics(self): |
| 309 return True | 314 return True |
| OLD | NEW |