Changeset 115490 in webkit


Ignore:
Timestamp:
Apr 27, 2012 2:03:29 PM (12 years ago)
Author:
dpranke@chromium.org
Message:

[chromium] use "drt-style" output, not "test-shell-style" output, on mac and linux DRT
https://bugs.webkit.org/show_bug.cgi?id=84917

Unreviewed, build fix.

Tools:

Reland the change in r115453 with a fix for chromium win.
The logic in ChromiumDriver was busted on windows, causing DRT
to get launched without the --test-shell flag.

  • Scripts/webkitpy/layout_tests/port/chromium.py:

(ChromiumDriver):
(ChromiumDriver.init):
(ChromiumDriver._wrapper_options):
(ChromiumDriver.cmd_line):
(ChromiumDriver._start):
(ChromiumDriver.has_crashed):
(ChromiumDriver.run_test):
(ChromiumDriver.stop):

  • Scripts/webkitpy/layout_tests/port/chromium_unittest.py:

(ChromiumDriverTest.setUp):
(ChromiumDriverTest.test_stop):
(ChromiumDriverTest.test_two_drivers.MockDriver.init):
(ChromiumDriverTest.test_two_drivers):

LayoutTests:

Reland the change in r115453 with a fix for chromium win.

  • platform/chromium/test_expectations.txt:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r115488 r115490  
     12012-04-27  Dirk Pranke  <dpranke@chromium.org>
     2
     3        [chromium] use "drt-style" output, not "test-shell-style" output, on mac and linux DRT
     4        https://bugs.webkit.org/show_bug.cgi?id=84917
     5
     6        Unreviewed, build fix.
     7
     8        Reland the change in r115453 with a fix for chromium win.
     9
     10        * platform/chromium/test_expectations.txt:
     11
    1122012-04-27  Eric Carlson  <eric.carlson@apple.com>
    213
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r115481 r115490  
    36973697BUGWK85082 XP DEBUG : platform/chromium/media/video-capture-preview.html = CRASH PASS
    36983698
     3699// This appears to be sensitive to --test-shell vs "drt mode" in DRT for some reason
     3700BUGWK85085 MAC LINUX : svg/custom/clip-path-referencing-use2.svg = TEXT
     3701
    36993702BUGWK85090 : fast/js/dfg-float64array.html = PASS TIMEOUT
    37003703BUGWK85090 : fast/js/dfg-uint16array.html = PASS TIMEOUT
  • trunk/Tools/ChangeLog

    r115489 r115490  
     12012-04-27  Dirk Pranke  <dpranke@chromium.org>
     2
     3        [chromium] use "drt-style" output, not "test-shell-style" output, on mac and linux DRT
     4        https://bugs.webkit.org/show_bug.cgi?id=84917
     5
     6        Unreviewed, build fix.
     7
     8        Reland the change in r115453 with a fix for chromium win.
     9        The logic in ChromiumDriver was busted on windows, causing DRT
     10        to get launched without the --test-shell flag.
     11
     12        * Scripts/webkitpy/layout_tests/port/chromium.py:
     13        (ChromiumDriver):
     14        (ChromiumDriver.__init__):
     15        (ChromiumDriver._wrapper_options):
     16        (ChromiumDriver.cmd_line):
     17        (ChromiumDriver._start):
     18        (ChromiumDriver.has_crashed):
     19        (ChromiumDriver.run_test):
     20        (ChromiumDriver.stop):
     21        * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
     22        (ChromiumDriverTest.setUp):
     23        (ChromiumDriverTest.test_stop):
     24        (ChromiumDriverTest.test_two_drivers.MockDriver.__init__):
     25        (ChromiumDriverTest.test_two_drivers):
     26
    1272012-04-27  Peter Beverloo  <peter@chromium.org>
    228
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py

    r115469 r115490  
    4747from webkitpy.layout_tests.models.test_configuration import TestConfiguration
    4848from webkitpy.layout_tests.port.base import Port, VirtualTestSuite
    49 from webkitpy.layout_tests.port.driver import Driver, DriverOutput
     49from webkitpy.layout_tests.port.driver import DriverOutput
     50from webkitpy.layout_tests.port.webkit import WebKitDriver
    5051from webkitpy.layout_tests.port import builders
    5152from webkitpy.layout_tests.servers import http_server
     
    404405
    405406
    406 # FIXME: This should inherit from WebKitDriver now that Chromium has a DumpRenderTree process like the rest of WebKit.
    407 class ChromiumDriver(Driver):
     407class ChromiumDriver(WebKitDriver):
     408    KILL_TIMEOUT_DEFAULT = 3.0
     409
    408410    def __init__(self, port, worker_number, pixel_tests, no_timeout=False):
    409         Driver.__init__(self, port, worker_number, pixel_tests, no_timeout)
     411        WebKitDriver.__init__(self, port, worker_number, pixel_tests, no_timeout)
    410412        self._proc = None
    411413        self._image_path = None
     414
     415        # FIXME: Make the regular webkit driver work on win as well so we can delete all of this driver code.
     416        if port.host.platform.is_win():
     417            if not hasattr(port._options, 'additional_drt_flag'):
     418                port._options.additional_drt_flag = []
     419            if not '--test-shell' in port._options.additional_drt_flag:
     420                port._options.additional_drt_flag.append('--test-shell')
     421
     422        self._test_shell = '--test-shell' in port.get_option('additional_drt_flag', [])
    412423
    413424    def _wrapper_options(self, pixel_tests):
    414425        cmd = []
    415426        if pixel_tests:
    416             if not self._image_path:
    417                 self._image_path = self._port._filesystem.join(self._port.results_directory(), 'png_result%s.png' % self._worker_number)
    418             # See note above in diff_image() for why we need _convert_path().
    419             cmd.append("--pixel-tests=" + self._port._convert_path(self._image_path))
     427            if self._test_shell:
     428                if not self._image_path:
     429                    self._image_path = self._port._filesystem.join(self._port.results_directory(), 'png_result%s.png' % self._worker_number)
     430                 # See note above in diff_image() for why we need _convert_path().
     431                cmd.append("--pixel-tests=" + self._port._convert_path(self._image_path))
     432            else:
     433                cmd.append('--pixel-tests')
     434
    420435        # FIXME: This is not None shouldn't be necessary, unless --js-flags="''" changes behavior somehow?
    421436        if self._port.get_option('js_flags') is not None:
     
    451466        cmd = self._command_wrapper(self._port.get_option('wrapper'))
    452467        cmd.append(self._port._path_to_driver())
    453         # FIXME: Why does --test-shell exist?  TestShell is dead, shouldn't this be removed?
    454         # It seems it's still in use in Tools/DumpRenderTree/chromium/DumpRenderTree.cpp as of 8/10/11.
    455         cmd.append('--test-shell')
    456468        cmd.extend(self._wrapper_options(pixel_tests))
    457469        cmd.extend(per_test_args)
    458470
     471        if not self._test_shell:
     472            cmd.append('-')
     473
    459474        return cmd
    460475
    461476    def _start(self, pixel_tests, per_test_args):
     477        if not self._test_shell:
     478            return super(ChromiumDriver, self)._start(pixel_tests, per_test_args)
     479
    462480        assert not self._proc
    463481        # FIXME: This should use ServerProcess like WebKitDriver does.
     
    467485
    468486    def has_crashed(self):
     487        if not self._test_shell:
     488            return super(ChromiumDriver, self).has_crashed()
     489
    469490        if self._proc is None:
    470491            return False
     
    524545
    525546    def run_test(self, driver_input):
     547        if not self._test_shell:
     548            return super(ChromiumDriver, self).run_test(driver_input)
     549
    526550        if not self._proc:
    527551            self._start(driver_input.should_run_pixel_test, driver_input.args)
     
    625649
    626650    def stop(self):
     651        if not self._test_shell:
     652            return super(ChromiumDriver, self).stop()
     653
    627654        if not self._proc:
    628655            return
    629         # FIXME: If we used ServerProcess all this would happen for free with ServerProces.stop()
    630656        self._proc.stdin.close()
    631657        self._proc.stdout.close()
     
    635661        if time_out_ms and not self._no_timeout:
    636662            timeout_ratio = float(time_out_ms) / self._port.default_test_timeout_ms()
    637             kill_timeout_seconds = 3.0 * timeout_ratio if timeout_ratio > 1.0 else 3.0
     663            kill_timeout_seconds = self.KILL_TIMEOUT_DEFAULT * timeout_ratio if timeout_ratio > 1.0 else self.KILL_TIMEOUT_DEFAULT
    638664        else:
    639             kill_timeout_seconds = 3.0
     665            kill_timeout_seconds = self.KILL_TIMEOUT_DEFAULT
    640666
    641667        # Closing stdin/stdout/stderr hangs sometimes on OS X,
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py

    r115469 r115490  
    3636from webkitpy.common.system.filesystem_mock import MockFileSystem
    3737from webkitpy.common.system.systemhost_mock import MockSystemHost
     38from webkitpy.layout_tests.port.config_mock import MockConfig
    3839from webkitpy.thirdparty.mock import Mock
    3940from webkitpy.tool.mocktool import MockOptions
     
    5253class ChromiumDriverTest(unittest.TestCase):
    5354    def setUp(self):
    54         mock_port = Mock()  # FIXME: This should use a tighter mock.
    55         mock_port.default_test_timeout_ms = lambda: 1000
    56         self.driver = chromium.ChromiumDriver(mock_port, worker_number=0, pixel_tests=True)
     55        host = MockSystemHost()
     56        options = MockOptions(configuration='Release', additional_drt_flag=['--test-shell'])
     57        config = MockConfig(filesystem=host.filesystem, default_configuration='Release')
     58        self.port = chromium_mac.ChromiumMacPort(host, 'chromium-mac-snowleopard', options=options, config=config)
     59        self.driver = chromium.ChromiumDriver(self.port, worker_number=0, pixel_tests=True)
    5760
    5861    def test_test_shell_command(self):
     
    133136
    134137        self.driver._port._executive = FakeExecutive()
    135         # Override the kill timeout (ms) so the test runs faster.
    136         self.driver._port.get_option = lambda name: 1
     138        self.driver.KILL_TIMEOUT_DEFAULT = 0.01
    137139        self.driver.stop()
    138140        self.assertTrue(self.wait_called)
     
    140142
    141143    def test_two_drivers(self):
    142         mock_port = Mock()
    143144
    144145        class MockDriver(chromium.ChromiumDriver):
    145             def __init__(self):
    146                 chromium.ChromiumDriver.__init__(self, mock_port, worker_number=0, pixel_tests=False)
     146            def __init__(self, port):
     147                chromium.ChromiumDriver.__init__(self, port, worker_number=0, pixel_tests=False)
    147148
    148149            def cmd_line(self, pixel_test, per_test_args):
     
    150151
    151152        # get_option is used to get the timeout (ms) for a process before we kill it.
    152         mock_port.get_option = lambda name: 60 * 1000
    153         mock_port.default_test_timeout_ms = lambda: 1000
    154         driver1 = MockDriver()
     153        driver1 = MockDriver(self.port)
    155154        driver1._start(False, [])
    156         driver2 = MockDriver()
     155        driver2 = MockDriver(self.port)
    157156        driver2._start(False, [])
    158157        # It's possible for driver1 to timeout when stopping if it's sharing stdin with driver2.
Note: See TracChangeset for help on using the changeset viewer.