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 os | 6 import os |
7 import pprint | 7 import pprint |
8 import re | 8 import re |
9 import shlex | 9 import shlex |
10 import sys | 10 import sys |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 def is_webview(self): | 139 def is_webview(self): |
140 return False | 140 return False |
141 | 141 |
142 def GetReplayBrowserStartupArgs(self): | 142 def GetReplayBrowserStartupArgs(self): |
143 replay_args = [] | 143 replay_args = [] |
144 network_backend = self.platform_backend.network_controller_backend | 144 network_backend = self.platform_backend.network_controller_backend |
145 if not network_backend.is_initialized: | 145 if not network_backend.is_initialized: |
146 return [] | 146 return [] |
147 proxy_port = network_backend.forwarder.port_pair.remote_port | 147 proxy_port = network_backend.forwarder.port_pair.remote_port |
148 replay_args.append('--proxy-server=socks://localhost:%s' % proxy_port) | 148 replay_args.append('--proxy-server=socks://localhost:%s' % proxy_port) |
149 if not network_backend.is_test_ca_installed and not self.is_webview: | 149 if not self.is_webview: |
150 # Ignore certificate errors for certs that are signed with Wpr's root. | 150 # Ignore certificate errors for certs that are signed with Wpr's root. |
151 # For more details on this flag, see crbug.com/753948. | 151 # For more details on this flag, see crbug.com/753948. |
152 wpr_public_hash_file = os.path.join(util.GetCatapultDir(), | 152 wpr_public_hash_file = os.path.join(util.GetCatapultDir(), |
153 'web_page_replay_go', | 153 'web_page_replay_go', |
154 'wpr_public_hash.txt') | 154 'wpr_public_hash.txt') |
155 if not os.path.exists(wpr_public_hash_file): | 155 if not os.path.exists(wpr_public_hash_file): |
156 raise exceptions.PathMissingError('Unable to find %s' % | 156 raise exceptions.PathMissingError('Unable to find %s' % |
157 wpr_public_hash_file) | 157 wpr_public_hash_file) |
158 with open(wpr_public_hash_file) as f: | 158 with open(wpr_public_hash_file) as f: |
159 wpr_public_hash = f.readline().strip() | 159 wpr_public_hash = f.readline().strip() |
160 replay_args.append('--ignore-certificate-errors-spki-list=' + | 160 replay_args.append('--ignore-certificate-errors-spki-list=' + |
161 wpr_public_hash) | 161 wpr_public_hash) |
162 elif not network_backend.is_test_ca_installed and self.is_webview: | 162 elif self.is_webview: |
163 # --ignore-certificate-errors-spki-list doesn't work with webview yet | 163 # --ignore-certificate-errors-spki-list doesn't work with webview yet |
164 # (crbug.com/753948) | 164 # (crbug.com/753948) |
165 replay_args.append('--ignore-certificate-errors') | 165 replay_args.append('--ignore-certificate-errors') |
166 return replay_args | 166 return replay_args |
167 | 167 |
168 def HasBrowserFinishedLaunching(self): | 168 def HasBrowserFinishedLaunching(self): |
169 assert self._port, 'No DevTools port info available.' | 169 assert self._port, 'No DevTools port info available.' |
170 return devtools_client_backend.IsDevToolsAgentAvailable( | 170 return devtools_client_backend.IsDevToolsAgentAvailable( |
171 self._port, | 171 self._port, |
172 self._browser_target, self) | 172 self._browser_target, self) |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 def supports_cpu_metrics(self): | 336 def supports_cpu_metrics(self): |
337 return True | 337 return True |
338 | 338 |
339 @property | 339 @property |
340 def supports_memory_metrics(self): | 340 def supports_memory_metrics(self): |
341 return True | 341 return True |
342 | 342 |
343 @property | 343 @property |
344 def supports_power_metrics(self): | 344 def supports_power_metrics(self): |
345 return True | 345 return True |
OLD | NEW |