Changeset 109242 in webkit
- Timestamp:
- Feb 29, 2012 12:04:07 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r109236 r109242 14 14 (WebViewHost): 15 15 (WebViewHost::currentIntentRequest): 16 17 2012-02-29 Dirk Pranke <dpranke@chromium.org> 18 19 nrwt: port/Driver needs to support per-test command line args 20 https://bugs.webkit.org/show_bug.cgi?id=79733 21 22 Reviewed by Adam Barth. 23 24 As part of removing the 'gpu' configurations and adding support 25 for 'virtual test suites', the Driver classes need to support 26 per-test command lines (since different tests will need to be 27 run with different command line options). 28 29 The per-test args are not yet used, so this change should have 30 no visible effects and need no additional testing. 31 32 * Scripts/webkitpy/layout_tests/port/base.py: 33 (Port.driver_cmd_line): 34 * Scripts/webkitpy/layout_tests/port/chromium.py: 35 (ChromiumDriver.cmd_line): 36 (ChromiumDriver._start): 37 (ChromiumDriver.start): 38 * Scripts/webkitpy/layout_tests/port/chromium_unittest.py: 39 (ChromiumDriverTest.test_two_drivers.MockDriver.cmd_line): 40 (ChromiumDriverTest): 41 (ChromiumDriverTest.test_two_drivers): 42 * Scripts/webkitpy/layout_tests/port/driver.py: 43 (Driver.cmd_line): 44 (DriverProxy.__init__): 45 (DriverProxy.start): 46 (DriverProxy.cmd_line): 47 * Scripts/webkitpy/layout_tests/port/driver_unittest.py: 48 (DriverTest.test_virtual_driver_methods): 49 * Scripts/webkitpy/layout_tests/port/gtk.py: 50 (GtkDriver.cmd_line): 51 * Scripts/webkitpy/layout_tests/port/mock_drt.py: 52 * Scripts/webkitpy/layout_tests/port/test.py: 53 (TestPort._path_to_driver): 54 (TestDriver.cmd_line): 55 (TestDriver.start): 56 * Scripts/webkitpy/layout_tests/port/webkit.py: 57 (WebKitDriver.cmd_line): 58 (WebKitDriver._start): 59 (WebKitDriver.run_test): 60 (WebKitDriver.start): 61 * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: 62 (WebKitDriverTest.test_no_timeout): 63 * Scripts/webkitpy/performance_tests/perftestsrunner.py: 64 (PerfTestsRunner._run_tests_set): 65 * Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py: 66 (test_run_test_pause_before_testing): 16 67 17 68 2012-02-29 Dirk Pranke <dpranke@chromium.org> -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r108413 r109242 534 534 """Prints the DRT command line that will be used.""" 535 535 driver = self.create_driver(0) 536 return driver.cmd_line( )536 return driver.cmd_line(self.get_option('pixel_tests'), []) 537 537 538 538 def update_baseline(self, baseline_path, data): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
r107620 r109242 399 399 self._image_path = self._port._filesystem.join(self._port.results_directory(), 'png_result%s.png' % self._worker_number) 400 400 401 def _wrapper_options(self ):401 def _wrapper_options(self, pixel_tests): 402 402 cmd = [] 403 if self._pixel_tests:403 if pixel_tests or self._pixel_tests: 404 404 # See note above in diff_image() for why we need _convert_path(). 405 405 cmd.append("--pixel-tests=" + self._port._convert_path(self._image_path)) … … 434 434 return cmd 435 435 436 def cmd_line(self ):436 def cmd_line(self, pixel_tests, per_test_args): 437 437 cmd = self._command_wrapper(self._port.get_option('wrapper')) 438 438 cmd.append(self._port._path_to_driver()) … … 440 440 # It seems it's still in use in Tools/DumpRenderTree/chromium/DumpRenderTree.cpp as of 8/10/11. 441 441 cmd.append('--test-shell') 442 cmd.extend(self._wrapper_options()) 442 cmd.extend(self._wrapper_options(pixel_tests)) 443 cmd.extend(per_test_args) 444 443 445 return cmd 444 446 445 def _start(self ):447 def _start(self, pixel_tests, per_test_args): 446 448 assert not self._proc 447 449 # FIXME: This should use ServerProcess like WebKitDriver does. 448 450 # FIXME: We should be reading stderr and stdout separately like how WebKitDriver does. 449 451 close_fds = sys.platform != 'win32' 450 self._proc = subprocess.Popen(self.cmd_line( ), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=close_fds)452 self._proc = subprocess.Popen(self.cmd_line(pixel_tests, per_test_args), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=close_fds) 451 453 452 454 def has_crashed(self): … … 509 511 def run_test(self, driver_input): 510 512 if not self._proc: 511 self._start( )513 self._start(driver_input.is_reftest or self._pixel_tests, []) 512 514 513 515 output = [] … … 595 597 crash=crash, crashed_process_name=crashed_process_name, test_time=run_time, timeout=timeout, error=error) 596 598 597 def start(self ):599 def start(self, pixel_tests, per_test_args): 598 600 if not self._proc: 599 self._start( )601 self._start(pixel_tests, per_test_args) 600 602 601 603 def stop(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
r107634 r109242 139 139 chromium.ChromiumDriver.__init__(self, mock_port, worker_number=0, pixel_tests=False) 140 140 141 def cmd_line(self ):141 def cmd_line(self, pixel_test, per_test_args): 142 142 return 'python' 143 143 … … 145 145 mock_port.get_option = lambda name: 60 * 1000 146 146 driver1 = MockDriver() 147 driver1._start( )147 driver1._start(False, []) 148 148 driver2 = MockDriver() 149 driver2._start( )149 driver2._start(False, []) 150 150 # It's possible for driver1 to timeout when stopping if it's sharing stdin with driver2. 151 151 start_time = time.time() -
trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py
r107286 r109242 163 163 raise NotImplementedError('Driver.stop') 164 164 165 def cmd_line(self ):165 def cmd_line(self, pixel_tests, per_test_args): 166 166 raise NotImplementedError('Driver.cmd_line') 167 167 … … 173 173 174 174 def __init__(self, port, worker_number, driver_instance_constructor, pixel_tests, no_timeout): 175 self._pixel_tests = pixel_tests 175 176 self._driver = driver_instance_constructor(port, worker_number, pixel_tests, no_timeout) 176 177 if pixel_tests: … … 197 198 198 199 def start(self): 199 self._driver.start() 200 # FIXME: Callers shouldn't normally call this, since this routine 201 # may not be specifying the correct combination of pixel test and 202 # per_test args. 203 # 204 # The only reason we have this routine at all is so the perftestrunner 205 # can pause before running a test; it might be better to push that 206 # into run_test() directly. 207 self._driver.start(self._pixel_tests, []) 200 208 201 209 def stop(self): … … 203 211 self._reftest_driver.stop() 204 212 205 def cmd_line(self ):206 cmd_line = self._driver.cmd_line( )213 def cmd_line(self, pixel_tests, per_test_args): 214 cmd_line = self._driver.cmd_line(pixel_tests, per_test_args) 207 215 if self._driver != self._reftest_driver: 208 cmd_line += ['; '] + self._reftest_driver.cmd_line( )216 cmd_line += ['; '] + self._reftest_driver.cmd_line(pixel_tests, per_test_args) 209 217 return cmd_line -
trunk/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py
r105981 r109242 92 92 self.assertVirtual(driver.run_test, None) 93 93 self.assertVirtual(driver.stop) 94 self.assertVirtual(driver.cmd_line )94 self.assertVirtual(driver.cmd_line, False, []) 95 95 96 96 def test_command_wrapper(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py
r109127 r109242 65 65 self._xvfb_process = None 66 66 67 def cmd_line(self ):67 def cmd_line(self, pixel_tests, per_test_args): 68 68 wrapper_path = self._port.path_from_webkit_base("Tools", "gtk", "run-with-jhbuild") 69 return [wrapper_path] + WebKitDriver.cmd_line(self )69 return [wrapper_path] + WebKitDriver.cmd_line(self, pixel_tests, per_test_args) 70 70 71 71 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py
r107755 r109242 94 94 @staticmethod 95 95 def _overriding_cmd_line(original_cmd_line, driver_path, python_exe, this_file, port_name): 96 def new_cmd_line( ):97 cmd_line = original_cmd_line( )96 def new_cmd_line(pixel_tests, per_test_args): 97 cmd_line = original_cmd_line(pixel_tests, per_test_args) 98 98 index = cmd_line.index(driver_path) 99 99 cmd_line[index:index + 1] = [python_exe, this_file, '--platform', port_name] … … 276 276 if self._options.pixel_tests and (test_input.image_hash or test_input.is_reftest): 277 277 self._stdout.write("#MD5:%s\n" % output.image_hash) 278 self._host.filesystem.maybe_make_directory(self._host.filesystem.dirname(self._options.pixel_path)) 278 279 self._host.filesystem.write_binary_file(self._options.pixel_path, 279 280 output.image) -
trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py
r108413 r109242 353 353 # This routine shouldn't normally be called, but it is called by 354 354 # the mock_drt Driver. We return something, but make sure it's useless. 355 return ' junk'355 return 'MOCK _path_to_driver' 356 356 357 357 def baseline_search_path(self): … … 494 494 """Test/Dummy implementation of the DumpRenderTree interface.""" 495 495 496 def cmd_line(self): 497 return [self._port._path_to_driver()] + self._port.get_option('additional_drt_flag', []) 496 def cmd_line(self, pixel_tests, per_test_args): 497 pixel_tests_flag = '-p' if pixel_tests else '' 498 return [self._port._path_to_driver()] + [pixel_tests_flag] + self._port.get_option('additional_drt_flag', []) + per_test_args 498 499 499 500 def run_test(self, test_input): … … 521 522 test_time=time.time() - start_time, timeout=test.timeout, error=test.error) 522 523 523 def start(self ):524 def start(self, pixel_tests, per_test_args): 524 525 pass 525 526 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
r107397 r109242 465 465 self._port._filesystem.rmtree(str(self._driver_tempdir)) 466 466 467 def cmd_line(self ):467 def cmd_line(self, pixel_tests, per_test_args): 468 468 cmd = self._command_wrapper(self._port.get_option('wrapper')) 469 469 cmd.append(self._port._path_to_driver()) 470 470 if self._port.get_option('skip_pixel_test_if_no_baseline'): 471 471 cmd.append('--skip-pixel-test-if-no-baseline') 472 if self._pixel_tests:473 cmd.append('--pixel-tests')474 472 if self._port.get_option('gc_between_tests'): 475 473 cmd.append('--gc-between-tests') … … 483 481 484 482 cmd.extend(self._port.get_option('additional_drt_flag', [])) 483 484 if pixel_tests or self._pixel_tests: 485 cmd.append('--pixel-tests') 486 cmd.extend(per_test_args) 487 485 488 cmd.append('-') 486 489 return cmd 487 490 488 def _start(self ):491 def _start(self, pixel_tests, per_test_args): 489 492 server_name = self._port.driver_name() 490 493 environment = self._port.setup_environ_for_server(server_name) … … 494 497 environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir() 495 498 self._crashed_subprocess_name = None 496 self._server_process = server_process.ServerProcess(self._port, server_name, self.cmd_line( ), environment)499 self._server_process = server_process.ServerProcess(self._port, server_name, self.cmd_line(pixel_tests, per_test_args), environment) 497 500 498 501 def has_crashed(self): … … 554 557 def run_test(self, driver_input): 555 558 if not self._server_process: 556 self._start( )559 self._start(driver_input.is_reftest or self._pixel_tests, []) 557 560 self.error_from_test = str() 558 561 self.err_seen_eof = False … … 646 649 return block 647 650 648 def start(self ):651 def start(self, pixel_tests, per_test_args): 649 652 if not self._server_process: 650 self._start( )653 self._start(pixel_tests, per_test_args) 651 654 652 655 def stop(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
r106735 r109242 301 301 port = TestWebKitPort() 302 302 driver = WebKitDriver(port, 0, pixel_tests=True, no_timeout=True) 303 self.assertEquals(driver.cmd_line( ), ['MOCK output of child process/DumpRenderTree', '--pixel-tests', '--no-timeout', '-'])303 self.assertEquals(driver.cmd_line(True, []), ['MOCK output of child process/DumpRenderTree', '--no-timeout', '--pixel-tests', '-']) -
trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
r109235 r109242 175 175 self.assertEqual(TestDriverWithStopCount.stop_count, 6) 176 176 177 def test_run_test_ set_kills_drt_per_run(self):177 def test_run_test_pause_before_testing(self): 178 178 class TestDriverWithStartCount(MainTest.TestDriver): 179 179 start_count = 0
Note: See TracChangeset
for help on using the changeset viewer.