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

Side by Side Diff: tools/telemetry/telemetry/core/browser_options.py

Issue 650963003: [Telemetry] Always use ephemeral port chosen by Chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 # Copyright 2012 The Chromium Authors. All rights reserved. 1 # Copyright 2012 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 copy 5 import copy
6 import logging 6 import logging
7 import optparse 7 import optparse
8 import os 8 import os
9 import shlex 9 import shlex
10 import sys 10 import sys
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 self.no_proxy_server = False 196 self.no_proxy_server = False
197 self.browser_user_agent_type = None 197 self.browser_user_agent_type = None
198 198
199 self.clear_sytem_cache_for_browser_and_profile_on_start = False 199 self.clear_sytem_cache_for_browser_and_profile_on_start = False
200 self.startup_url = 'about:blank' 200 self.startup_url = 'about:blank'
201 201
202 # Background pages of built-in component extensions can interfere with 202 # Background pages of built-in component extensions can interfere with
203 # performance measurements. 203 # performance measurements.
204 self.disable_component_extensions_with_background_pages = True 204 self.disable_component_extensions_with_background_pages = True
205 205
206 # Whether to use the new code path for choosing an ephemeral port for
207 # DevTools. The bots set this to true. When Chrome 37 reaches stable,
208 # remove this setting and the old code path. http://crbug.com/379980
209 self.use_devtools_active_port = False
210
211 def __repr__(self): 206 def __repr__(self):
212 return str(sorted(self.__dict__.items())) 207 return str(sorted(self.__dict__.items()))
213 208
214 @classmethod 209 @classmethod
215 def AddCommandLineArgs(cls, parser): 210 def AddCommandLineArgs(cls, parser):
216 211
217 ############################################################################ 212 ############################################################################
218 # Please do not add any more options here without first discussing with # 213 # Please do not add any more options here without first discussing with #
219 # a telemetry owner. This is not the right place for platform-specific # 214 # a telemetry owner. This is not the right place for platform-specific #
220 # options. # 215 # options. #
(...skipping 22 matching lines...) Expand all
243 group.add_option('--netsim', default=None, type='choice', 238 group.add_option('--netsim', default=None, type='choice',
244 choices=net_configs.NET_CONFIG_NAMES, 239 choices=net_configs.NET_CONFIG_NAMES,
245 help=('Run benchmark under simulated network conditions. ' 240 help=('Run benchmark under simulated network conditions. '
246 'Will prompt for sudo. Supported values: ' + 241 'Will prompt for sudo. Supported values: ' +
247 ', '.join(net_configs.NET_CONFIG_NAMES))) 242 ', '.join(net_configs.NET_CONFIG_NAMES)))
248 group.add_option('--show-stdout', 243 group.add_option('--show-stdout',
249 action='store_true', 244 action='store_true',
250 help='When possible, will display the stdout of the process') 245 help='When possible, will display the stdout of the process')
251 # This hidden option is to be removed, and the older code path deleted, 246 # This hidden option is to be removed, and the older code path deleted,
252 # once Chrome 37 reaches Stable. http://crbug.com/379980 247 # once Chrome 37 reaches Stable. http://crbug.com/379980
253 group.add_option('--use-devtools-active-port', 248 group.add_option('--use-devtools-active-port',
Ken Russell (switch to Gerrit) 2014/10/14 05:57:14 We should remove this too after landing this CL an
254 action='store_true', 249 action='store_true',
255 help=optparse.SUPPRESS_HELP) 250 help=optparse.SUPPRESS_HELP)
256 parser.add_option_group(group) 251 parser.add_option_group(group)
257 252
258 group = optparse.OptionGroup(parser, 'Compatibility options') 253 group = optparse.OptionGroup(parser, 'Compatibility options')
259 group.add_option('--gtest_output', 254 group.add_option('--gtest_output',
260 help='Ignored argument for compatibility with runtest.py harness') 255 help='Ignored argument for compatibility with runtest.py harness')
261 parser.add_option_group(group) 256 parser.add_option_group(group)
262 257
263 group = optparse.OptionGroup(parser, 'Synthetic gesture options') 258 group = optparse.OptionGroup(parser, 'Synthetic gesture options')
(...skipping 12 matching lines...) Expand all
276 def UpdateFromParseResults(self, finder_options): 271 def UpdateFromParseResults(self, finder_options):
277 """Copies our options from finder_options""" 272 """Copies our options from finder_options"""
278 browser_options_list = [ 273 browser_options_list = [
279 'extra_browser_args_as_string', 274 'extra_browser_args_as_string',
280 'extra_wpr_args_as_string', 275 'extra_wpr_args_as_string',
281 'netsim', 276 'netsim',
282 'profile_dir', 277 'profile_dir',
283 'profile_type', 278 'profile_type',
284 'show_stdout', 279 'show_stdout',
285 'synthetic_gesture_source_type', 280 'synthetic_gesture_source_type',
286 'use_devtools_active_port',
287 ] 281 ]
288 for o in browser_options_list: 282 for o in browser_options_list:
289 a = getattr(finder_options, o, None) 283 a = getattr(finder_options, o, None)
290 if a is not None: 284 if a is not None:
291 setattr(self, o, a) 285 setattr(self, o, a)
292 delattr(finder_options, o) 286 delattr(finder_options, o)
293 287
294 self.browser_type = finder_options.browser_type 288 self.browser_type = finder_options.browser_type
295 289
296 if hasattr(self, 'extra_browser_args_as_string'): # pylint: disable=E1101 290 if hasattr(self, 'extra_browser_args_as_string'): # pylint: disable=E1101
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 324
331 @property 325 @property
332 def extra_browser_args(self): 326 def extra_browser_args(self):
333 return self._extra_browser_args 327 return self._extra_browser_args
334 328
335 def AppendExtraBrowserArgs(self, args): 329 def AppendExtraBrowserArgs(self, args):
336 if isinstance(args, list): 330 if isinstance(args, list):
337 self._extra_browser_args.update(args) 331 self._extra_browser_args.update(args)
338 else: 332 else:
339 self._extra_browser_args.add(args) 333 self._extra_browser_args.add(args)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698