Changeset 240163 in webkit
- Timestamp:
- Jan 18, 2019 12:12:38 PM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r240161 r240163 1 2019-01-18 Jonathan Bedard <jbedard@apple.com> 2 3 webkitpy: Add iPhone and iPad ports 4 https://bugs.webkit.org/show_bug.cgi?id=193537 5 <rdar://problem/47353390> 6 7 Reviewed by Lucas Forschler. 8 9 Add --iphone-simulator and --ipad-simulator commands to run-webkit-tests which separate iPhone and iPad into separate 10 ports. Note that this separation is optional, the --ios-simulator command remains. 11 12 * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: 13 (RunTest.test_device_type_test_division): Drive-by fix. 14 (RunTest.test_device_type_specific_listing): Ditto. 15 (RunTest.test_ipad_test_division): 16 (RunTest): 17 (RunTest.test_ipad_listing): 18 * Scripts/webkitpy/port/factory.py: 19 (platform_options): Add --iphone-simulator and --ipad-simulator flags. 20 (PortFactory): 21 * Scripts/webkitpy/port/ios_simulator.py: 22 (IPhoneSimulatorPort): 23 (IPadSimulatorPort): 24 1 25 2019-01-18 Chris Dumez <cdumez@apple.com> 2 26 -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
r240150 r240163 29 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 30 31 import codecs32 31 import json 33 import logging34 import os35 import platform36 import Queue37 import re38 32 import StringIO 39 import sys40 import thread41 import time42 import threading43 33 import unittest 44 34 … … 49 39 from webkitpy.common.host_mock import MockHost 50 40 51 from webkitpy import port52 41 from webkitpy.layout_tests import run_webkit_tests 53 42 from webkitpy.layout_tests.models.test_run_results import INTERRUPTED_EXIT_STATUS 54 from webkitpy.port import Port55 43 from webkitpy.port import test 56 from webkitpy.test.skip import skip_if57 44 from webkitpy.xcode.device_type import DeviceType 58 45 … … 858 845 if str(DeviceType.from_string('iPhone SE')) in line: 859 846 self.assertTrue('Skipping 2 tests' in line) 860 elif str(DeviceType.from_string('iP hone(5th generation)')) in line:847 elif str(DeviceType.from_string('iPad (5th generation)')) in line: 861 848 self.assertTrue('Skipping 1 test' in line) 862 849 elif str(DeviceType.from_string('iPhone 7')) in line: … … 882 869 by_type = {} 883 870 for line in output.splitlines(): 884 if not line :871 if not line or 'skip' in line: 885 872 continue 886 873 if 'Tests to run' in line: … … 894 881 self.assertEqual(1, len(by_type[DeviceType.from_string('iPad (5th generation)')])) 895 882 self.assertEqual(0, len(by_type[DeviceType.from_string('iPhone 7')])) 883 884 def test_ipad_test_division(self): 885 host = MockHost() 886 port = host.port_factory.get('ipad-simulator') 887 888 host.filesystem.write_text_file('/mock-checkout/LayoutTests/test1.html', '') 889 host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/ios/test2.html', '') 890 host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/ipad/test3.html', '') 891 host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/iphone/test4.html', '') 892 host.filesystem.write_text_file('/MOCK output of child process/ImageDiff', '') 893 894 oc = outputcapture.OutputCapture() 895 try: 896 oc.capture_output() 897 logging = StringIO.StringIO() 898 run_webkit_tests.run(port, run_webkit_tests.parse_args(['--debug-rwt-logging', '-n', '--no-build', '--root', '/build'])[0], [], logging_stream=logging) 899 finally: 900 output, err, _ = oc.restore_output() 901 902 for line in logging.getvalue(): 903 if str(DeviceType.from_string('iPad (5th generation)')) in line: 904 self.assertTrue('Skipping 3 test' in line) 905 906 def test_ipad_listing(self): 907 host = MockHost() 908 port = host.port_factory.get('ipad-simulator') 909 910 host.filesystem.write_text_file('/mock-checkout/LayoutTests/test1.html', '') 911 host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/ios/test2.html', '') 912 host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/ipad/test3.html', '') 913 host.filesystem.write_text_file('/mock-checkout/LayoutTests/platform/iphone/test4.html', '') 914 915 oc = outputcapture.OutputCapture() 916 try: 917 oc.capture_output() 918 logging = StringIO.StringIO() 919 run_webkit_tests._print_expectations(port, run_webkit_tests.parse_args([])[0], [], logging_stream=logging) 920 finally: 921 output, _, _ = oc.restore_output() 922 923 current_type = None 924 by_type = {} 925 for line in output.splitlines(): 926 if not line or 'skip' in line: 927 continue 928 if 'Tests to run' in line: 929 current_type = DeviceType.from_string(line.split('for ')[-1].split(' running')[0]) if 'for ' in line else None 930 by_type[current_type] = [] 931 continue 932 by_type[current_type].append(line) 933 934 self.assertEqual(1, len(by_type.keys())) 935 self.assertEqual(3, len(by_type[DeviceType.from_string('iPad (5th generation)')])) 896 936 897 937 -
trunk/Tools/Scripts/webkitpy/port/factory.py
r238590 r240163 48 48 const=('ios-simulator'), 49 49 help=('Alias for --platform=ios-simulator')), 50 optparse.make_option('--iphone-simulator', action='store_const', dest='platform', 51 const=('iphone-simulator'), 52 help=('Alias for --platform=iphone-simulator')), 53 optparse.make_option('--ipad-simulator', action='store_const', dest='platform', 54 const=('ipad-simulator'), 55 help=('Alias for --platform=ipad-simulator')), 50 56 optparse.make_option('--simulator', action='store_const', dest='platform', 51 57 const=('ios-simulator'), … … 91 97 'gtk.GtkPort', 92 98 'ios_simulator.IOSSimulatorPort', 99 'ios_simulator.IPhoneSimulatorPort', 100 'ios_simulator.IPadSimulatorPort', 93 101 'ios_device.IOSDevicePort', 94 102 'watch_simulator.WatchSimulatorPort', -
trunk/Tools/Scripts/webkitpy/port/ios_simulator.py
r240150 r240163 110 110 def stderr_patterns_to_strip(self): 111 111 return [] 112 113 114 class IPhoneSimulatorPort(IOSSimulatorPort): 115 port_name = 'iphone-simulator' 116 117 DEVICE_TYPE = DeviceType(hardware_family='iPhone') 118 DEFAULT_DEVICE_TYPES = [ 119 DeviceType(hardware_family='iPhone', hardware_type='SE'), 120 DeviceType(hardware_family='iPhone', hardware_type='7'), 121 ] 122 123 124 class IPadSimulatorPort(IOSSimulatorPort): 125 port_name = 'ipad-simulator' 126 127 DEVICE_TYPE = DeviceType(hardware_family='iPad') 128 DEFAULT_DEVICE_TYPES = [DeviceType(hardware_family='iPad', hardware_type='(5th generation)')]
Note: See TracChangeset
for help on using the changeset viewer.