webkitpy: Refactor setup_test_run for IOSPort and IOSSimulator
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Mar 2017 20:05:50 +0000 (20:05 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Mar 2017 20:05:50 +0000 (20:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169220
<rdar://problem/30879645>

Reviewed by Daniel Bates.

Provide more specific port setup functions for iOS ports to allow more sharing of common code.

* Scripts/webkitpy/port/ios.py:
(IOSPort):
(IOSPort._create_devices): Added.
(IOSPort.setup_test_run): Shared iOS device setup code.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort._create_devices): Renamed from setup_test_run.
(IOSSimulatorPort.setup_test_run): Renamed as _create_devices.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213530 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/port/ios.py
Tools/Scripts/webkitpy/port/ios_simulator.py

index 784018b..b7ca767 100644 (file)
@@ -1,3 +1,21 @@
+2017-03-07  Jonathan Bedard  <jbedard@apple.com>
+
+        webkitpy: Refactor setup_test_run for IOSPort and IOSSimulator
+        https://bugs.webkit.org/show_bug.cgi?id=169220
+        <rdar://problem/30879645>
+
+        Reviewed by Daniel Bates.
+
+        Provide more specific port setup functions for iOS ports to allow more sharing of common code.
+
+        * Scripts/webkitpy/port/ios.py:
+        (IOSPort):
+        (IOSPort._create_devices): Added.
+        (IOSPort.setup_test_run): Shared iOS device setup code.
+        * Scripts/webkitpy/port/ios_simulator.py:
+        (IOSSimulatorPort._create_devices): Renamed from setup_test_run.
+        (IOSSimulatorPort.setup_test_run): Renamed as _create_devices.
+
 2017-03-07  Anders Carlsson  <andersca@apple.com>
 
         Rewrite the DRT Pasteboard implementation to use UTIs and WTF types
index ed0e12f..ce9c6b9 100644 (file)
@@ -76,3 +76,9 @@ class IOSPort(DarwinPort):
         if self.using_multiple_devices():
             return self._testing_device(number)
         return self._current_device
+
+    def _create_devices(self, device_class):
+        raise NotImplementedError
+
+    def setup_test_run(self, device_class=None):
+        self._create_devices(device_class)
index 6b556b9..9cc6580 100644 (file)
@@ -210,7 +210,7 @@ class IOSSimulatorPort(IOSPort):
                 _log.warn("Expected simulator of type '" + self.simulator_device_type().name + "' but found simulator of type '" + self._current_device.name + "'")
                 _log.warn('The next block of tests may fail due to device mis-match')
 
-    def setup_test_run(self, device_class=None):
+    def _create_devices(self, device_class):
         mac_os_version = self.host.platform.os_version
 
         self._set_device_class(device_class)