Changeset 252722 in webkit
- Timestamp:
- Nov 20, 2019, 5:25:19 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/xcode/simulated_device.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r252719 r252722 1 2019-11-20 Jonathan Bedard <jbedard@apple.com> 2 3 run-webkit-tests: Do not create global SystemHost objects 4 https://bugs.webkit.org/show_bug.cgi?id=204426 5 6 Reviewed by Aakash Jain. 7 8 If created, SystemHost objects should be created on-demand, not globally 9 shared between all instances of a function. 10 11 * Scripts/webkitpy/xcode/simulated_device.py: 12 (SimulatedDeviceManager.populate_available_devices): 13 (SimulatedDeviceManager.available_devices): 14 (SimulatedDeviceManager.device_by_filter): 15 (SimulatedDeviceManager._create_or_find_device_for_request): 16 (SimulatedDeviceManager._boot_device): 17 (SimulatedDeviceManager.device_count_for_type): 18 (SimulatedDeviceManager.initialize_devices): 19 (SimulatedDeviceManager.max_supported_simulators): 20 (SimulatedDeviceManager.swap): 21 (SimulatedDeviceManager.tear_down): 22 1 23 2019-11-20 Wenson Hsieh <wenson_hsieh@apple.com> 2 24 -
trunk/Tools/Scripts/webkitpy/xcode/simulated_device.py
r251793 r252722 124 124 125 125 @staticmethod 126 def populate_available_devices(host=SystemHost()): 126 def populate_available_devices(host=None): 127 host = host or SystemHost() 127 128 if not host.platform.is_mac(): 128 129 return … … 158 159 159 160 @staticmethod 160 def available_devices(host=SystemHost()): 161 def available_devices(host=None): 162 host = host or SystemHost() 161 163 if SimulatedDeviceManager.AVAILABLE_DEVICES == []: 162 164 SimulatedDeviceManager.populate_available_devices(host) … … 164 166 165 167 @staticmethod 166 def device_by_filter(filter, host=SystemHost()): 168 def device_by_filter(filter, host=None): 169 host = host or SystemHost() 167 170 result = [] 168 171 for device in SimulatedDeviceManager.available_devices(host): … … 250 253 251 254 @staticmethod 252 def _create_or_find_device_for_request(request, host= SystemHost(), name_base='Managed'):255 def _create_or_find_device_for_request(request, host=None, name_base='Managed'): 253 256 assert isinstance(request, DeviceRequest) 257 host = host or SystemHost() 254 258 255 259 device = SimulatedDeviceManager._find_exisiting_device_for_request(request) … … 334 338 335 339 @staticmethod 336 def _boot_device(device, host=SystemHost()): 340 def _boot_device(device, host=None): 341 host = host or SystemHost() 337 342 _log.debug(u"Booting device '{}'".format(device.udid)) 338 343 device.platform_device.booted_by_script = True … … 341 346 342 347 @staticmethod 343 def device_count_for_type(device_type, host=SystemHost(), use_booted_simulator=True, **kwargs): 348 def device_count_for_type(device_type, host=None, use_booted_simulator=True, **kwargs): 349 host = host or SystemHost() 344 350 if not host.platform.is_mac(): 345 351 return 0 … … 355 361 356 362 @staticmethod 357 def initialize_devices(requests, host=SystemHost(), name_base='Managed', simulator_ui=True, timeout=SIMULATOR_BOOT_TIMEOUT, **kwargs): 363 def initialize_devices(requests, host=None, name_base='Managed', simulator_ui=True, timeout=SIMULATOR_BOOT_TIMEOUT, **kwargs): 364 host = host or SystemHost() 358 365 if SimulatedDeviceManager.INITIALIZED_DEVICES is not None: 359 366 return SimulatedDeviceManager.INITIALIZED_DEVICES … … 411 418 @staticmethod 412 419 @memoized 413 def max_supported_simulators(host=SystemHost()): 420 def max_supported_simulators(host=None): 421 host = host or SystemHost() 414 422 if not host.platform.is_mac(): 415 423 return 0 … … 439 447 440 448 @staticmethod 441 def swap(device, request, host=SystemHost(), name_base='Managed', timeout=SIMULATOR_BOOT_TIMEOUT): 449 def swap(device, request, host=None, name_base='Managed', timeout=SIMULATOR_BOOT_TIMEOUT): 450 host = host or SystemHost() 442 451 if SimulatedDeviceManager.INITIALIZED_DEVICES is None: 443 452 raise RuntimeError('Cannot swap when there are no initialized devices') … … 462 471 463 472 @staticmethod 464 def tear_down(host=SystemHost(), timeout=SIMULATOR_BOOT_TIMEOUT): 473 def tear_down(host=None, timeout=SIMULATOR_BOOT_TIMEOUT): 474 host = host or SystemHost() 465 475 if SimulatedDeviceManager._managing_simulator_app: 466 476 host.executive.run_command(['killall', '-9', 'Simulator'], return_exit_code=True)
Note:
See TracChangeset
for help on using the changeset viewer.