Make it possible to use an existing simulator instance for one-off testing
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2016 20:02:11 +0000 (20:02 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Dec 2016 20:02:11 +0000 (20:02 +0000)
commit5e2d9a382af3c86c0ca2b36d812ac25226fb4187
treee009bb5b3d8dc25c840a81ee3c2bd6edf430b3ee
parent21e2fd84ffb22ad9d4d3e9a5580c6775d9b058f2
Make it possible to use an existing simulator instance for one-off testing
https://bugs.webkit.org/show_bug.cgi?id=164568
<rdar://problem/29189133>

Reviewed by Daniel Bates.

With this patch, if a simulator is currently running on the machine and
'--dedicated-simulators' is not passed into the application, only one simulator
instance will be used, and this instance will be the existing instance.
If no simulator is running or '--dedicated-simulators' is passed to the script,
previous behavior will be used.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.__init__): Logic for enabling usage of currently running simulator.
(IOSSimulatorPort._create_simulators): Only create simulators when needed, don't reset already running simulators.
(IOSSimulatorPort.setup_test_run): Don't open already running simulators.
(IOSSimulatorPort._quit_ios_simulator): Only quit simulators if we manage them.
(IOSSimulatorPort.clean_up_test_run): Only clean up simulators if we manage them.
(IOSSimulatorPort._using_dedicated_simulators): True if simulators need to be managed, false if using an existing instance.
(IOSSimulatorPort.device_id_for_worker_number): Access currently running simulator if not managing devices.
* Scripts/webkitpy/xcode/simulator.py:
(Simulator.refresh): Check if xcode_simctl_list returned None instead of a generator.
(Simulator.current_device): Get currently running device.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@209337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
Tools/Scripts/webkitpy/port/ios.py
Tools/Scripts/webkitpy/xcode/simulator.py