Changeset 109242 in webkit


Ignore:
Timestamp:
Feb 29, 2012 12:04:07 PM (12 years ago)
Author:
dpranke@chromium.org
Message:

Add more tests for web intents
https://bugs.webkit.org/show_bug.cgi?id=79527

Patch by Greg Billock <gbillock@google.com> on 2012-02-29
Reviewed by Adam Barth.

  • DumpRenderTree/chromium/LayoutTestController.cpp:

(LayoutTestController::LayoutTestController):
(LayoutTestController::sendWebIntentResponse):

  • DumpRenderTree/chromium/LayoutTestController.h:

(LayoutTestController):

  • DumpRenderTree/chromium/WebViewHost.h:

(WebViewHost):
(WebViewHost::currentIntentRequest):

Location:
trunk/Tools
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r109236 r109242  
    1414        (WebViewHost):
    1515        (WebViewHost::currentIntentRequest):
     16
     172012-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):
    1667
    17682012-02-29  Dirk Pranke  <dpranke@chromium.org>
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    r108413 r109242  
    534534        """Prints the DRT command line that will be used."""
    535535        driver = self.create_driver(0)
    536         return driver.cmd_line()
     536        return driver.cmd_line(self.get_option('pixel_tests'), [])
    537537
    538538    def update_baseline(self, baseline_path, data):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py

    r107620 r109242  
    399399            self._image_path = self._port._filesystem.join(self._port.results_directory(), 'png_result%s.png' % self._worker_number)
    400400
    401     def _wrapper_options(self):
     401    def _wrapper_options(self, pixel_tests):
    402402        cmd = []
    403         if self._pixel_tests:
     403        if pixel_tests or self._pixel_tests:
    404404            # See note above in diff_image() for why we need _convert_path().
    405405            cmd.append("--pixel-tests=" + self._port._convert_path(self._image_path))
     
    434434        return cmd
    435435
    436     def cmd_line(self):
     436    def cmd_line(self, pixel_tests, per_test_args):
    437437        cmd = self._command_wrapper(self._port.get_option('wrapper'))
    438438        cmd.append(self._port._path_to_driver())
     
    440440        # It seems it's still in use in Tools/DumpRenderTree/chromium/DumpRenderTree.cpp as of 8/10/11.
    441441        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
    443445        return cmd
    444446
    445     def _start(self):
     447    def _start(self, pixel_tests, per_test_args):
    446448        assert not self._proc
    447449        # FIXME: This should use ServerProcess like WebKitDriver does.
    448450        # FIXME: We should be reading stderr and stdout separately like how WebKitDriver does.
    449451        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)
    451453
    452454    def has_crashed(self):
     
    509511    def run_test(self, driver_input):
    510512        if not self._proc:
    511             self._start()
     513            self._start(driver_input.is_reftest or self._pixel_tests, [])
    512514
    513515        output = []
     
    595597            crash=crash, crashed_process_name=crashed_process_name, test_time=run_time, timeout=timeout, error=error)
    596598
    597     def start(self):
     599    def start(self, pixel_tests, per_test_args):
    598600        if not self._proc:
    599             self._start()
     601            self._start(pixel_tests, per_test_args)
    600602
    601603    def stop(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py

    r107634 r109242  
    139139                chromium.ChromiumDriver.__init__(self, mock_port, worker_number=0, pixel_tests=False)
    140140
    141             def cmd_line(self):
     141            def cmd_line(self, pixel_test, per_test_args):
    142142                return 'python'
    143143
     
    145145        mock_port.get_option = lambda name: 60 * 1000
    146146        driver1 = MockDriver()
    147         driver1._start()
     147        driver1._start(False, [])
    148148        driver2 = MockDriver()
    149         driver2._start()
     149        driver2._start(False, [])
    150150        # It's possible for driver1 to timeout when stopping if it's sharing stdin with driver2.
    151151        start_time = time.time()
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py

    r107286 r109242  
    163163        raise NotImplementedError('Driver.stop')
    164164
    165     def cmd_line(self):
     165    def cmd_line(self, pixel_tests, per_test_args):
    166166        raise NotImplementedError('Driver.cmd_line')
    167167
     
    173173
    174174    def __init__(self, port, worker_number, driver_instance_constructor, pixel_tests, no_timeout):
     175        self._pixel_tests = pixel_tests
    175176        self._driver = driver_instance_constructor(port, worker_number, pixel_tests, no_timeout)
    176177        if pixel_tests:
     
    197198
    198199    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, [])
    200208
    201209    def stop(self):
     
    203211        self._reftest_driver.stop()
    204212
    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)
    207215        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)
    209217        return cmd_line
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py

    r105981 r109242  
    9292        self.assertVirtual(driver.run_test, None)
    9393        self.assertVirtual(driver.stop)
    94         self.assertVirtual(driver.cmd_line)
     94        self.assertVirtual(driver.cmd_line, False, [])
    9595
    9696    def test_command_wrapper(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py

    r109127 r109242  
    6565            self._xvfb_process = None
    6666
    67     def cmd_line(self):
     67    def cmd_line(self, pixel_tests, per_test_args):
    6868        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)
    7070
    7171
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py

    r107755 r109242  
    9494    @staticmethod
    9595    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)
    9898            index = cmd_line.index(driver_path)
    9999            cmd_line[index:index + 1] = [python_exe, this_file, '--platform', port_name]
     
    276276        if self._options.pixel_tests and (test_input.image_hash or test_input.is_reftest):
    277277            self._stdout.write("#MD5:%s\n" % output.image_hash)
     278            self._host.filesystem.maybe_make_directory(self._host.filesystem.dirname(self._options.pixel_path))
    278279            self._host.filesystem.write_binary_file(self._options.pixel_path,
    279280                                                    output.image)
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py

    r108413 r109242  
    353353        # This routine shouldn't normally be called, but it is called by
    354354        # the mock_drt Driver. We return something, but make sure it's useless.
    355         return 'junk'
     355        return 'MOCK _path_to_driver'
    356356
    357357    def baseline_search_path(self):
     
    494494    """Test/Dummy implementation of the DumpRenderTree interface."""
    495495
    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
    498499
    499500    def run_test(self, test_input):
     
    521522            test_time=time.time() - start_time, timeout=test.timeout, error=test.error)
    522523
    523     def start(self):
     524    def start(self, pixel_tests, per_test_args):
    524525        pass
    525526
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py

    r107397 r109242  
    465465        self._port._filesystem.rmtree(str(self._driver_tempdir))
    466466
    467     def cmd_line(self):
     467    def cmd_line(self, pixel_tests, per_test_args):
    468468        cmd = self._command_wrapper(self._port.get_option('wrapper'))
    469469        cmd.append(self._port._path_to_driver())
    470470        if self._port.get_option('skip_pixel_test_if_no_baseline'):
    471471            cmd.append('--skip-pixel-test-if-no-baseline')
    472         if self._pixel_tests:
    473             cmd.append('--pixel-tests')
    474472        if self._port.get_option('gc_between_tests'):
    475473            cmd.append('--gc-between-tests')
     
    483481
    484482        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
    485488        cmd.append('-')
    486489        return cmd
    487490
    488     def _start(self):
     491    def _start(self, pixel_tests, per_test_args):
    489492        server_name = self._port.driver_name()
    490493        environment = self._port.setup_environ_for_server(server_name)
     
    494497        environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
    495498        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)
    497500
    498501    def has_crashed(self):
     
    554557    def run_test(self, driver_input):
    555558        if not self._server_process:
    556             self._start()
     559            self._start(driver_input.is_reftest or self._pixel_tests, [])
    557560        self.error_from_test = str()
    558561        self.err_seen_eof = False
     
    646649        return block
    647650
    648     def start(self):
     651    def start(self, pixel_tests, per_test_args):
    649652        if not self._server_process:
    650             self._start()
     653            self._start(pixel_tests, per_test_args)
    651654
    652655    def stop(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py

    r106735 r109242  
    301301        port = TestWebKitPort()
    302302        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  
    175175        self.assertEqual(TestDriverWithStopCount.stop_count, 6)
    176176
    177     def test_run_test_set_kills_drt_per_run(self):
     177    def test_run_test_pause_before_testing(self):
    178178        class TestDriverWithStartCount(MainTest.TestDriver):
    179179            start_count = 0
Note: See TracChangeset for help on using the changeset viewer.