Changeset 121812 in webkit
- Timestamp:
- Jul 3, 2012 4:53:26 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r121809 r121812 1 2012-07-03 Dirk Pranke <dpranke@chromium.org> 2 3 nrwt: fix mock port 4 https://bugs.webkit.org/show_bug.cgi?id=90500 5 6 Reviewed by Ojan Vafai. 7 8 The MockDRT code was never updated when we switched the chromium 9 ports to using "drt mode" by default. This change updates that 10 code, fixes a typo in the chromium port that went undetected 11 (default_test_timeout_ms -> default_timeout_ms), and adds tests 12 that actually exercise some of the mock ports. These tests are 13 useful in that they will exercise the port-specific code in an 14 end-to-end-manner, but they are a bit slow for some reason (>1s 15 each) that I need to look into. 16 17 * Scripts/webkitpy/layout_tests/port/chromium.py: 18 (ChromiumDriver.stop): 19 * Scripts/webkitpy/layout_tests/port/chromium_android.py: 20 (ChromiumAndroidPort.default_timeout_ms): 21 * Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py: 22 (TestChromiumAndroidPort.test_default_timeout_ms): 23 * Scripts/webkitpy/layout_tests/port/mock_drt.py: 24 (main): 25 (parse_options): 26 (MockTestShell): 27 (MockTestShell.output_for_test): 28 * Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py: 29 (MockDRTTest.assertTest): 30 (MockTestShellTest): 31 (MockTestShellTest.make_drt): 32 (MockTestShellTest.test_test_shell_parse_options): 33 * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py: 34 (PortTest): 35 (PortTest.assert_mock_port_works): 36 (PortTest.test_chromium_mac_lion): 37 (PortTest.test_chromium_mac_lion_in_test_shell_mode): 38 (PortTest.test_qt_linux): 39 (PortTest.test_mac_lion): 40 1 41 2012-07-03 Dirk Pranke <dpranke@chromium.org> 2 42 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
r121784 r121812 694 694 time_out_ms = self._port.get_option('time_out_ms') 695 695 if time_out_ms and not self._no_timeout: 696 timeout_ratio = float(time_out_ms) / self._port.default_t est_timeout_ms()696 timeout_ratio = float(time_out_ms) / self._port.default_timeout_ms() 697 697 kill_timeout_seconds = self.KILL_TIMEOUT_DEFAULT * timeout_ratio if timeout_ratio > 1.0 else self.KILL_TIMEOUT_DEFAULT 698 698 else: -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
r121614 r121812 179 179 self._drt_retry_after_killed = 0 180 180 181 def default_t est_timeout_ms(self):181 def default_timeout_ms(self): 182 182 # Android platform has less computing power than desktop platforms. 183 183 # Using 10 seconds allows us to pass most slow tests which are not … … 215 215 216 216 # FIXME: Remove this function when chromium-android is fully upstream. 217 def expectations_files(self): 217 def expectations_files(self): 218 218 android_expectations_file = self.path_from_webkit_base('LayoutTests', 'platform', 'chromium', 'test_expectations_android.txt') 219 219 return super(ChromiumAndroidPort, self).expectations_files() + [android_expectations_file] -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android_unittest.py
r121497 r121812 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import optparse 29 30 import StringIO 30 31 import unittest … … 49 50 self.assertTrue(port.get_option('enable_hardware_gpu')) 50 51 self.assertEquals(port.baseline_path(), port._webkit_baseline_path('chromium-android')) 52 53 def test_default_timeout_ms(self): 54 self.assertEquals(self.make_port(options=optparse.Values({'configuration': 'Release'})).default_timeout_ms(), 10000) 55 self.assertEquals(self.make_port(options=optparse.Values({'configuration': 'Debug'})).default_timeout_ms(), 10000) 51 56 52 57 def test_expectations_files(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py
r121497 r121812 40 40 import base64 41 41 import logging 42 import optparse 42 43 import os 43 44 import sys … … 52 53 from webkitpy.layout_tests.port.driver import DriverInput, DriverOutput, DriverProxy 53 54 from webkitpy.layout_tests.port.factory import PortFactory 54 from webkitpy.tool.mocktool import MockOptions55 55 56 56 _log = logging.getLogger(__name__) … … 131 131 132 132 options, args = parse_options(argv) 133 if options. chromium:134 drt = Mock ChromiumDRT(options, args, host, stdin, stdout, stderr)133 if options.test_shell: 134 drt = MockTestShell(options, args, host, stdin, stdout, stderr) 135 135 else: 136 136 drt = MockDRT(options, args, host, stdin, stdout, stderr) … … 152 152 pixel_tests = False 153 153 pixel_path = None 154 chromium = False 155 if platform.startswith('chromium'): 156 chromium = True 154 test_shell = '--test-shell' in argv 155 if test_shell: 157 156 for arg in argv: 158 157 if arg.startswith('--pixel-tests'): … … 161 160 else: 162 161 pixel_tests = '--pixel-tests' in argv 163 options = MockOptions(chromium=chromium, platform=platform, pixel_tests=pixel_tests, pixel_path=pixel_path)162 options = optparse.Values({'test_shell': test_shell, 'platform': platform, 'pixel_tests': pixel_tests, 'pixel_path': pixel_path}) 164 163 return (options, argv) 165 164 … … 256 255 257 256 258 class Mock ChromiumDRT(MockDRT):257 class MockTestShell(MockDRT): 259 258 def input_from_line(self, line): 260 259 vals = line.strip().split() … … 273 272 if '--enable-accelerated-2d-canvas' in self._args and 'canvas' in test_input.test_name: 274 273 test_input.test_name = 'platform/chromium/virtual/gpu/' + test_input.test_name 275 output = super(Mock ChromiumDRT, self).output_for_test(test_input, is_reftest)274 output = super(MockTestShell, self).output_for_test(test_input, is_reftest) 276 275 test_input.test_name = original_test_name 277 276 return output -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py
r119520 r121812 151 151 # the StringIO might be a mix of unicode/ascii and 8-bit strings. 152 152 self.assertEqual(stdout.buflist, drt_output) 153 self.assertEqual(stderr.getvalue(), '' if options. chromiumelse '#EOF\n')153 self.assertEqual(stderr.getvalue(), '' if options.test_shell else '#EOF\n') 154 154 155 155 def test_main(self): … … 202 202 203 203 204 205 class MockChromiumDRTTest(MockDRTTest): 204 class MockTestShellTest(MockDRTTest): 206 205 def extra_args(self, pixel_tests): 207 206 if pixel_tests: … … 210 209 211 210 def make_drt(self, options, args, host, stdin, stdout, stderr): 212 options. chromium= True211 options.test_shell = True 213 212 214 213 # We have to set these by hand because --platform test won't trigger … … 217 216 options.pixel_tests = True 218 217 219 return mock_drt.Mock ChromiumDRT(options, args, host, stdin, stdout, stderr)218 return mock_drt.MockTestShell(options, args, host, stdin, stdout, stderr) 220 219 221 220 def input_line(self, port, test_name, checksum=None): … … 252 251 {'/tmp/png_result0.png': 'image_checksum\x8a-pngtEXtchecksum\x00image_checksum-checksum'}) 253 252 254 def test_ chromium_parse_options(self):255 options, args = mock_drt.parse_options(['--platform', 'chromium-mac', 253 def test_test_shell_parse_options(self): 254 options, args = mock_drt.parse_options(['--platform', 'chromium-mac', '--test-shell', 256 255 '--pixel-tests=/tmp/png_result0.png']) 257 self.assertTrue(options. chromium)256 self.assertTrue(options.test_shell) 258 257 self.assertTrue(options.pixel_tests) 259 258 self.assertEquals(options.pixel_path, '/tmp/png_result0.png') -
trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
r121509 r121812 47 47 from webkitpy.common.system.crashlogs_unittest import make_mock_crash_report_darwin 48 48 from webkitpy.common.system.systemhost import SystemHost 49 from webkitpy.common.host import Host 49 50 from webkitpy.common.host_mock import MockHost 50 51 … … 1012 1013 1013 1014 1015 class PortTest(unittest.TestCase): 1016 def assert_mock_port_works(self, port_name, args=[]): 1017 self.assertTrue(passing_run(args + ['--platform', 'mock-' + port_name, 'fast/harness/results.html'], tests_included=True, host=Host())) 1018 1019 def test_chromium_mac_lion(self): 1020 self.assert_mock_port_works('chromium-mac-lion') 1021 1022 def test_chromium_mac_lion_in_test_shell_mode(self): 1023 self.assert_mock_port_works('chromium-mac-lion', args=['--additional-drt-flag=--test-shell']) 1024 1025 def test_qt_linux(self): 1026 self.assert_mock_port_works('qt-linux') 1027 1028 def test_mac_lion(self): 1029 self.assert_mock_port_works('mac-lion') 1030 1014 1031 if __name__ == '__main__': 1015 1032 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.