Changeset 103952 in webkit
- Timestamp:
- Jan 3, 2012 11:53:50 AM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r103943 r103952 1 2012-01-03 Adam Roben <aroben@apple.com> 2 3 Make Port subclasses override the operating_system method rather than setting an attribute 4 5 Without this patch, any use of Port.operating_system() within a port's __init__ method would 6 return the default value ("mac"). This was confusing the version-checking logic inside 7 ApplePort.__init__ on Windows. 8 9 Fixes <http://webkit.org/b/75479> <rdar://problem/10637385> REGRESSION (r102161): NRWT 10 crashes on launch on Windows 7 SP1 11 12 Reviewed by Eric Seidel. 13 14 * Scripts/webkitpy/layout_tests/port/apple.py: 15 (ApplePort.__init__): Replaced uses of self._operating_system with self.operating_system(). 16 17 * Scripts/webkitpy/layout_tests/port/base.py: 18 (Port.__init__): Removed code that set the self._operating_system attribute. Subclasses 19 should now override the operating_system method instead. 20 (Port.operating_system): Changed to always return "mac". Subclasses should override to 21 return something else. 22 23 * Scripts/webkitpy/layout_tests/port/chromium_linux.py: 24 (ChromiumLinuxPort.__init__): 25 (ChromiumLinuxPort.operating_system): 26 * Scripts/webkitpy/layout_tests/port/chromium_mac.py: 27 (ChromiumMacPort.__init__): 28 (ChromiumMacPort.operating_system): 29 * Scripts/webkitpy/layout_tests/port/chromium_win.py: 30 (ChromiumWinPort.__init__): 31 (ChromiumWinPort.operating_system): 32 * Scripts/webkitpy/layout_tests/port/mac.py: 33 (MacPort.__init__): 34 (MacPort.operating_system): 35 * Scripts/webkitpy/layout_tests/port/win.py: 36 (WinPort.__init__): 37 (WinPort.operating_system): 38 Changed to override the operating_system method rather than setting the _operating_system 39 attribute, since setting the attribute isn't sufficient for code inside __init__ methods. 40 41 * Scripts/webkitpy/layout_tests/port/qt.py: 42 (QtPort.__init__): 43 (QtPort._path_to_webcore_library): 44 Changed to use self.operating_system() instead of self._operating_system, for consistency 45 with other Port-related code. 46 47 (QtPort.operating_system): Added this override of Port.operating_system that returns the 48 value we determined in our __init__ method. 49 50 * Scripts/webkitpy/layout_tests/port/test.py: 51 (TestPort.operating_system): Added this override of Port.operating_system that returns the 52 value we determined in our __init__ method. 53 54 * Scripts/webkitpy/layout_tests/port/base_unittest.py: 55 (PortTest.test_operating_system): 56 * Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py: 57 (ChromiumLinuxPortTest.test_operating_system): 58 * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py: 59 (ChromiumMacPortTest.test_operating_system): 60 * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py: 61 (ChromiumWinPortTest.test_operating_system): 62 * Scripts/webkitpy/layout_tests/port/mac_unittest.py: 63 (MacPortTest.test_operating_system): 64 * Scripts/webkitpy/layout_tests/port/qt_unittest.py: 65 (QtPortTest.test_operating_system): 66 * Scripts/webkitpy/layout_tests/port/win_unittest.py: 67 (WinPortTest.test_operating_system): 68 Test that all ports return the expected operating system string. 69 1 70 2012-01-03 Mario Sanchez Prada <msanchez@igalia.com> 2 71 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/apple.py
r102161 r103952 71 71 self._name = self.port_name + '-' + self._version 72 72 else: 73 allowed_port_names = self.VERSION_FALLBACK_ORDER + [self. _operating_system+ "-future"]73 allowed_port_names = self.VERSION_FALLBACK_ORDER + [self.operating_system() + "-future"] 74 74 assert port_name in allowed_port_names, "%s is not in %s" % (port_name, allowed_port_names) 75 75 self._version = self._strip_port_name_prefix(port_name) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r103289 r103952 93 93 # These are default values that should be overridden in a subclasses. 94 94 self._name = port_name or self.port_name # Subclasses may append a -VERSION (like mac-leopard) or other qualifiers. 95 self._operating_system = 'mac'96 95 self._version = '' 97 96 self._architecture = 'x86' … … 636 635 637 636 def operating_system(self): 638 return self._operating_system 637 # Subclasses should override this default implementation. 638 return 'mac' 639 639 640 640 def version(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
r103289 r103952 349 349 'bar/test-3.html': [('==', 'bar/test-ref.html'), ('==', 'bar/test-ref2.html'), ('!=', 'bar/test-notref.html')]}) 350 350 351 def test_operating_system(self): 352 self.assertEqual('mac', self.make_port().operating_system()) 353 351 354 352 355 class VirtualTest(unittest.TestCase): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
r99773 r103952 75 75 'chromium-gpu-linux-x86_64') 76 76 self._name = port_name 77 self._operating_system = 'linux'78 77 self._version = 'lucid' # We only support lucid right now. 79 78 … … 111 110 _log.error(' http://code.google.com/p/chromium/wiki/LinuxBuildInstructions') 112 111 return result 112 113 def operating_system(self): 114 return 'linux' 113 115 114 116 # -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux_unittest.py
r99781 r103952 87 87 self.assertRaises(AssertionError, chromium_linux.ChromiumLinuxPort, host) 88 88 89 def test_operating_system(self): 90 self.assertEqual('linux', self.make_port().operating_system()) 91 89 92 90 93 if __name__ == '__main__': -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
r102454 r103952 126 126 else: 127 127 self._graphics_type = 'cpu' 128 self._operating_system = 'mac'129 128 130 129 def baseline_search_path(self): … … 150 149 return 1 151 150 return chromium.ChromiumPort.default_child_processes(self) 151 152 def operating_system(self): 153 return 'mac' 152 154 153 155 # -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
r102454 r103952 86 86 self.assertEquals('cpu', self.make_port().graphics_type()) 87 87 88 def test_operating_system(self): 89 self.assertEqual('mac', self.make_port().operating_system()) 90 88 91 89 92 if __name__ == '__main__': -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py
r100674 r103952 96 96 self._version = port_name[port_name.index('-win-') + len('-win-'):] 97 97 assert self._version in self.SUPPORTED_VERSIONS, "%s is not in %s" % (self._version, self.SUPPORTED_VERSIONS) 98 self._operating_system = 'win'99 98 100 99 … … 131 130 _log.error(' http://dev.chromium.org/developers/how-tos/build-instructions-windows') 132 131 return result 132 133 def operating_system(self): 134 return 'win' 133 135 134 136 def relative_test_filename(self, filename): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
r100674 r103952 127 127 '/mock-checkout/Source/WebKit/chromium/build/Debug/DumpRenderTree.exe', 128 128 port._path_to_driver('Debug')) 129 130 def test_operating_system(self): 131 self.assertEqual('win', self.make_port().operating_system()) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py
r102161 r103952 76 76 77 77 def __init__(self, host, **kwargs): 78 self._operating_system = 'mac'79 78 ApplePort.__init__(self, host, **kwargs) 80 79 self._leak_detector = LeakDetector(self) … … 105 104 env['XML_CATALOG_FILES'] = '' # work around missing /etc/catalog <rdar://problem/4292995> 106 105 return env 106 107 def operating_system(self): 108 return 'mac' 107 109 108 110 # Belongs on a Platform object. -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py
r102161 r103952 163 163 expected_stderr = "MOCK run_command: ['Tools/Scripts/run-safari', '--release', '-NSOpen', 'test.html'], cwd=/mock-checkout\n" 164 164 OutputCapture().assert_outputs(self, port.show_results_html_file, ["test.html"], expected_stderr=expected_stderr) 165 166 def test_operating_system(self): 167 self.assertEqual('mac', self.make_port().operating_system()) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py
r102766 r103952 64 64 WebKitPort.__init__(self, host, port_name=None, **kwargs) 65 65 self._operating_system = self._operating_system_for_platform(sys_platform or sys.platform) 66 self._version = self. _operating_system66 self._version = self.operating_system() 67 67 68 68 # FIXME: This will allow WebKitPort.baseline_search_path and WebKitPort._skipped_file_search_paths … … 73 73 else: 74 74 name_components = [self.port_name] 75 if self. _operating_system:76 name_components.append(self. _operating_system)75 if self.operating_system(): 76 name_components.append(self.operating_system()) 77 77 self._name = "-".join(name_components) 78 78 … … 95 95 96 96 def _path_to_webcore_library(self): 97 if self. _operating_system== 'mac':97 if self.operating_system() == 'mac': 98 98 return self._build_path('lib/QtWebKit.framework/QtWebKit') 99 99 else: … … 156 156 run_launcher_args.append("file://%s" % results_filename) 157 157 self._run_script("run-launcher", run_launcher_args) 158 159 def operating_system(self): 160 return self._operating_system -
trunk/Tools/Scripts/webkitpy/layout_tests/port/qt_unittest.py
r103253 r103952 84 84 env = port.setup_environ_for_server(port.driver_name()) 85 85 self.assertEquals(env['QTWEBKIT_PLUGIN_PATH'], 'MOCK output of child process/lib/plugins') 86 87 def test_operating_system(self): 88 self.assertEqual('linux', self.make_port(sys_platform='linux').operating_system()) 89 self.assertEqual('mac', self.make_port(sys_platform='darwin').operating_system()) 90 self.assertEqual('win', self.make_port(sys_platform='cygwin').operating_system()) 91 self.assertEqual('win', self.make_port(sys_platform='win32').operating_system()) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py
r103254 r103952 378 378 return self._name 379 379 380 def operating_system(self): 381 return self._operating_system 382 380 383 def _path_to_wdiff(self): 381 384 return None -
trunk/Tools/Scripts/webkitpy/layout_tests/port/win.py
r102161 r103952 75 75 return self._version_string_from_windows_version_tuple(version_tuple) 76 76 77 def __init__(self, host, **kwargs):78 self._operating_system = 'win'79 ApplePort.__init__(self, host, **kwargs)80 81 77 def compare_text(self, expected_text, actual_text): 82 78 # Sanity was restored in WK2, so we don't need this hack there. … … 109 105 return map(self._webkit_baseline_path, fallback_names) 110 106 107 def operating_system(self): 108 return 'win' 109 111 110 # This port may need to override setup_environ_for_server 112 111 # to match behavior of setPathForRunningWebKitApp from ORWT. -
trunk/Tools/Scripts/webkitpy/layout_tests/port/win_unittest.py
r99781 r103952 104 104 port._options = MockOptions(webkit_test_runner=True) 105 105 self.assertTrue(port.compare_text(expected, "foo\n")) 106 107 def test_operating_system(self): 108 self.assertEqual('win', self.make_port().operating_system())
Note: See TracChangeset
for help on using the changeset viewer.