- Revision
- 221087
- Author
- [email protected]
- Date
- 2017-08-23 11:09:06 -0700 (Wed, 23 Aug 2017)
Log Message
Access expectations path through apple_additions
https://bugs.webkit.org/show_bug.cgi?id=174800
<rdar://problem/33498899>
Reviewed by David Kilzer.
Follow-up fix. Mapping of operating system names was done incorrectly.
* Scripts/webkitpy/port/ios.py:
(IOSPort._apple_additions_path): Correctly find the operating system to be replaced.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest.test_layout_test_searchpath_with_apple_additions): Add test for operating
system name replacement.
* Scripts/webkitpy/port/ios_simulator_unittest.py:
(IOSSimulatorTest.test_layout_test_searchpath_with_apple_additions): Add test for operating
system name replacement.
* Scripts/webkitpy/port/mac.py: Correctly find the operating system to be replaced.
(MacPort._apple_additions_path):
* Scripts/webkitpy/port/mac_unittest.py:
(MacTest.test_layout_test_searchpath_with_apple_additions): Add test for operating system
name replacement.
* Scripts/webkitpy/port/port_testcase.py:
(bind_mock_apple_additions.MockAppleAdditions.ios_os_name): Change the passed name so that
operating system name replacement can be tested.
(bind_mock_apple_additions.MockAppleAdditions.mac_os_name): Ditto.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (221086 => 221087)
--- trunk/Tools/ChangeLog 2017-08-23 17:54:03 UTC (rev 221086)
+++ trunk/Tools/ChangeLog 2017-08-23 18:09:06 UTC (rev 221087)
@@ -4,6 +4,34 @@
https://bugs.webkit.org/show_bug.cgi?id=174800
<rdar://problem/33498899>
+ Reviewed by David Kilzer.
+
+ Follow-up fix. Mapping of operating system names was done incorrectly.
+
+ * Scripts/webkitpy/port/ios.py:
+ (IOSPort._apple_additions_path): Correctly find the operating system to be replaced.
+ * Scripts/webkitpy/port/ios_device_unittest.py:
+ (IOSDeviceTest.test_layout_test_searchpath_with_apple_additions): Add test for operating
+ system name replacement.
+ * Scripts/webkitpy/port/ios_simulator_unittest.py:
+ (IOSSimulatorTest.test_layout_test_searchpath_with_apple_additions): Add test for operating
+ system name replacement.
+ * Scripts/webkitpy/port/mac.py: Correctly find the operating system to be replaced.
+ (MacPort._apple_additions_path):
+ * Scripts/webkitpy/port/mac_unittest.py:
+ (MacTest.test_layout_test_searchpath_with_apple_additions): Add test for operating system
+ name replacement.
+ * Scripts/webkitpy/port/port_testcase.py:
+ (bind_mock_apple_additions.MockAppleAdditions.ios_os_name): Change the passed name so that
+ operating system name replacement can be tested.
+ (bind_mock_apple_additions.MockAppleAdditions.mac_os_name): Ditto.
+
+2017-08-23 Jonathan Bedard <[email protected]>
+
+ Access expectations path through apple_additions
+ https://bugs.webkit.org/show_bug.cgi?id=174800
+ <rdar://problem/33498899>
+
Reviewed by Alexey Proskuryakov.
When external test expectations are imported through additional-platform-directory, they will
Modified: trunk/Tools/Scripts/webkitpy/port/ios.py (221086 => 221087)
--- trunk/Tools/Scripts/webkitpy/port/ios.py 2017-08-23 17:54:03 UTC (rev 221086)
+++ trunk/Tools/Scripts/webkitpy/port/ios.py 2017-08-23 18:09:06 UTC (rev 221087)
@@ -91,11 +91,16 @@
if name == 'wk2':
return None
split_name = name.split('-')
- if len(split_name) > 1 and split_name[1] != 'wk1' and split_name[1] != 'wk2' and split_name[1] != 'simulator' and split_name[1] != 'device':
- os_name = apple_additions().ios_os_name(split_name[1])
+ os_index = -1
+ for i in xrange(2):
+ if split_name[os_index] == 'wk1' or split_name[os_index] == 'wk2' or split_name[os_index] == 'simulator' or split_name[os_index] == 'device':
+ os_index -= 1
+ if split_name[os_index] != split_name[0]:
+ os_name = apple_additions().mac_os_name(split_name[os_index])
if not os_name:
return None
- name = split_name[0] + '-' + os_name + ('-' + '-'.join(split_name[2:]) if len(split_name) > 2 else '')
+ split_name[os_index] = os_name
+ name = '-'.join(split_name)
return self._filesystem.join(apple_additions().layout_tests_path(), name)
@memoized
Modified: trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py (221086 => 221087)
--- trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py 2017-08-23 17:54:03 UTC (rev 221086)
+++ trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py 2017-08-23 18:09:06 UTC (rev 221087)
@@ -93,15 +93,15 @@
def test_layout_test_searchpath_with_apple_additions(self):
with port_testcase.bind_mock_apple_additions():
search_path = self.make_port().default_baseline_search_path()
- self.assertEqual(search_path[0], '/additional_testing_path/ios-device-11-wk1')
+ self.assertEqual(search_path[0], '/additional_testing_path/ios-device-add-11-wk1')
self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/ios-device-11-wk1')
- self.assertEqual(search_path[2], '/additional_testing_path/ios-device-11')
+ self.assertEqual(search_path[2], '/additional_testing_path/ios-device-add-11')
self.assertEqual(search_path[3], '/mock-checkout/LayoutTests/platform/ios-device-11')
self.assertEqual(search_path[4], '/additional_testing_path/ios-device-wk1')
self.assertEqual(search_path[5], '/mock-checkout/LayoutTests/platform/ios-device-wk1')
self.assertEqual(search_path[6], '/additional_testing_path/ios-device')
self.assertEqual(search_path[7], '/mock-checkout/LayoutTests/platform/ios-device')
- self.assertEqual(search_path[8], '/additional_testing_path/ios-11')
+ self.assertEqual(search_path[8], '/additional_testing_path/ios-add-11')
self.assertEqual(search_path[9], '/mock-checkout/LayoutTests/platform/ios-11')
self.assertEqual(search_path[10], '/additional_testing_path/ios-wk1')
self.assertEqual(search_path[11], '/mock-checkout/LayoutTests/platform/ios-wk1')
Modified: trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py (221086 => 221087)
--- trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py 2017-08-23 17:54:03 UTC (rev 221086)
+++ trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py 2017-08-23 18:09:06 UTC (rev 221087)
@@ -92,15 +92,15 @@
def test_layout_test_searchpath_with_apple_additions(self):
with port_testcase.bind_mock_apple_additions():
search_path = self.make_port().default_baseline_search_path()
- self.assertEqual(search_path[0], '/additional_testing_path/ios-simulator-8-wk1')
+ self.assertEqual(search_path[0], '/additional_testing_path/ios-simulator-add-8-wk1')
self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/ios-simulator-8-wk1')
- self.assertEqual(search_path[2], '/additional_testing_path/ios-simulator-8')
+ self.assertEqual(search_path[2], '/additional_testing_path/ios-simulator-add-8')
self.assertEqual(search_path[3], '/mock-checkout/LayoutTests/platform/ios-simulator-8')
self.assertEqual(search_path[4], '/additional_testing_path/ios-simulator-wk1')
self.assertEqual(search_path[5], '/mock-checkout/LayoutTests/platform/ios-simulator-wk1')
self.assertEqual(search_path[6], '/additional_testing_path/ios-simulator')
self.assertEqual(search_path[7], '/mock-checkout/LayoutTests/platform/ios-simulator')
- self.assertEqual(search_path[8], '/additional_testing_path/ios-8')
+ self.assertEqual(search_path[8], '/additional_testing_path/ios-add-8')
self.assertEqual(search_path[9], '/mock-checkout/LayoutTests/platform/ios-8')
self.assertEqual(search_path[10], '/additional_testing_path/ios-wk1')
self.assertEqual(search_path[11], '/mock-checkout/LayoutTests/platform/ios-wk1')
Modified: trunk/Tools/Scripts/webkitpy/port/mac.py (221086 => 221087)
--- trunk/Tools/Scripts/webkitpy/port/mac.py 2017-08-23 17:54:03 UTC (rev 221086)
+++ trunk/Tools/Scripts/webkitpy/port/mac.py 2017-08-23 18:09:06 UTC (rev 221087)
@@ -61,11 +61,15 @@
if name == 'wk2':
return None
split_name = name.split('-')
- if len(split_name) > 1 and split_name[1] != 'wk1' and split_name[1] != 'wk2':
- os_name = apple_additions().mac_os_name(split_name[1])
+ os_index = -1
+ if split_name[-1] == 'wk1' or split_name[-1] == 'wk2':
+ os_index = -2
+ if split_name[os_index] != split_name[0]:
+ os_name = apple_additions().mac_os_name(split_name[os_index])
if not os_name:
return None
- name = split_name[0] + '-' + os_name + ('-' + '-'.join(split_name[2:])) if len(split_name) > 2 else ''
+ split_name[os_index] = os_name
+ name = '-'.join(split_name)
return self._filesystem.join(apple_additions().layout_tests_path(), name)
@memoized
Modified: trunk/Tools/Scripts/webkitpy/port/mac_unittest.py (221086 => 221087)
--- trunk/Tools/Scripts/webkitpy/port/mac_unittest.py 2017-08-23 17:54:03 UTC (rev 221086)
+++ trunk/Tools/Scripts/webkitpy/port/mac_unittest.py 2017-08-23 18:09:06 UTC (rev 221087)
@@ -146,5 +146,7 @@
def test_layout_test_searchpath_with_apple_additions(self):
with port_testcase.bind_mock_apple_additions():
search_path = self.make_port().default_baseline_search_path()
- self.assertEqual(search_path[0], '/additional_testing_path/mac-lion-wk1')
+ self.assertEqual(search_path[0], '/additional_testing_path/mac-add-lion-wk1')
self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/mac-lion-wk1')
+ self.assertEqual(search_path[2], '/additional_testing_path/mac-add-lion')
+ self.assertEqual(search_path[3], '/mock-checkout/LayoutTests/platform/mac-lion')
Modified: trunk/Tools/Scripts/webkitpy/port/port_testcase.py (221086 => 221087)
--- trunk/Tools/Scripts/webkitpy/port/port_testcase.py 2017-08-23 17:54:03 UTC (rev 221086)
+++ trunk/Tools/Scripts/webkitpy/port/port_testcase.py 2017-08-23 18:09:06 UTC (rev 221087)
@@ -87,11 +87,11 @@
@staticmethod
def ios_os_name(name):
- return name
+ return 'add-{}'.format(name)
@staticmethod
def mac_os_name(name):
- return name
+ return 'add-{}'.format(name)
# apple_additions is a memoized function. Take advantage of this fact and manipulate the cache
# to temporarily return a mocked result