⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243771 in webkit


Ignore:
Timestamp:
Apr 2, 2019, 5:04:06 PM (7 years ago)
Author:
Kocsen Chung
Message:

Cherry-pick r239989. rdar://problem/49539128

webkitpy: Implement device type specific expected results (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=192162

Reviewed by Lucas Forschler.

Device type specific expected results covers two related ideas. The first (covered by this change)
is where to search for -expected.* files. The second is which tests to run based on the
TestExpectations.txt file.

After this change, the baseline search path will be determined by the type of device running a
test. Device type will be passed into any function which picks a file based on the baseline search
path.

  • Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py: (Worker._update_test_input): Pass device_type to self._port.reference_files(...).
  • Scripts/webkitpy/layout_tests/controllers/manager.py: (Manager.run): Print baseline search path for each round of devices.
  • Scripts/webkitpy/layout_tests/controllers/single_test_runner.py: (SingleTestRunner.init): Pass device_type into expected_*(...). (SingleTestRunner._expected_driver_output): Ditto. (SingleTestRunner._driver_input): Ditto.
  • Scripts/webkitpy/layout_tests/views/printing.py: (Printer.print_config): Move printing of baseline search path to a separate function. (Printer.print_baseline_search_path): Moved from Printer.print_config.
  • Scripts/webkitpy/layout_tests/views/printing_unittest.py: (Testprinter.test_print_config): (Testprinter.test_print_baseline_search_path):
  • Scripts/webkitpy/port/base.py: (Port.baseline_search_path): Pass device_type through. (Port._expected_baselines_for_suffixes): Ditto. (Port.expected_baselines): Ditto. (Port.expected_filename): Ditto. (Port.expected_checksum): Ditto. (Port.expected_image): Ditto. (Port.expected_audio): Ditto. (Port.expected_text): Ditto. (Port.reference_files): Ditto. (Port.tests): Ditto. (Port._expanded_paths): Ditto. (Port.skipped_layout_tests): Ditto. (Port.expectations_dict): Ditto. (Port._port_specific_expectations_files): Ditto. (Port.expectations_files): Ditto. (Port.test_search_path): Ditto. (Port._tests_for_other_platforms): Ditto.
  • Scripts/webkitpy/port/base_unittest.py: (PortTest.test_additional_platform_directory): Accept, but do not use, device_type. (PortTest.test_nonexistant_expectations): Ditto. (test_ref_tests_platform_directory): Ditto.
  • Scripts/webkitpy/port/darwin.py: (DarwinPort._port_specific_expectations_files): Accept device_type.
  • Scripts/webkitpy/port/driver.py: (DriverProxy): (DriverProxy.host): Expose _target_host for device_type information.
  • Scripts/webkitpy/port/gtk.py: (GtkPort._port_specific_expectations_files): Accept, but do not use, device_type.
  • Scripts/webkitpy/port/ios.py: (IOSPort. default_baseline_search_path): Remove memoized, since it does not accept kwargs.
  • Scripts/webkitpy/port/mac.py: (MacPort. default_baseline_search_path): Ditto.
  • Scripts/webkitpy/port/port_testcase.py: (TestWebKitPort._tests_for_other_platforms): Accept, but do not use, device_type.
  • Scripts/webkitpy/port/test.py:
  • Scripts/webkitpy/port/watch.py: (WatchPort. default_baseline_search_path): Remove memoized, since it does not accept kwargs.
  • Scripts/webkitpy/port/win.py: (WinPort.test_search_path): Accept, but do not use, device_type.
  • Scripts/webkitpy/port/wpe.py: (WPEPort._port_specific_expectations_files): Ditto.
  • Scripts/webkitpy/tool/servers/rebaselineserver.py: (get_test_baselines.AllPlatformsPort.baseline_search_path): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239989 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-607-branch/Tools
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/Tools/ChangeLog

    r243770 r243771  
     12019-04-02  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r239989. rdar://problem/49539128
     4
     5    webkitpy: Implement device type specific expected results (Part 1)
     6    https://bugs.webkit.org/show_bug.cgi?id=192162
     7   
     8    Reviewed by Lucas Forschler.
     9   
     10    Device type specific expected results covers two related ideas. The first (covered by this change)
     11    is where to search for -expected.* files. The second is which tests to run based on the
     12    TestExpectations.txt file.
     13   
     14    After this change, the baseline search path will be determined by the type of device running a
     15    test. Device type will be passed into any function which picks a file based on the baseline search
     16    path.
     17   
     18    * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
     19    (Worker._update_test_input): Pass device_type to self._port.reference_files(...).
     20    * Scripts/webkitpy/layout_tests/controllers/manager.py:
     21    (Manager.run): Print baseline search path for each round of devices.
     22    * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
     23    (SingleTestRunner.__init__): Pass device_type into expected_*(...).
     24    (SingleTestRunner._expected_driver_output): Ditto.
     25    (SingleTestRunner._driver_input): Ditto.
     26    * Scripts/webkitpy/layout_tests/views/printing.py:
     27    (Printer.print_config): Move printing of baseline search path to a separate function.
     28    (Printer.print_baseline_search_path): Moved from Printer.print_config.
     29    * Scripts/webkitpy/layout_tests/views/printing_unittest.py:
     30    (Testprinter.test_print_config):
     31    (Testprinter.test_print_baseline_search_path):
     32    * Scripts/webkitpy/port/base.py:
     33    (Port.baseline_search_path): Pass device_type through.
     34    (Port._expected_baselines_for_suffixes): Ditto.
     35    (Port.expected_baselines): Ditto.
     36    (Port.expected_filename): Ditto.
     37    (Port.expected_checksum): Ditto.
     38    (Port.expected_image): Ditto.
     39    (Port.expected_audio): Ditto.
     40    (Port.expected_text): Ditto.
     41    (Port.reference_files): Ditto.
     42    (Port.tests): Ditto.
     43    (Port._expanded_paths): Ditto.
     44    (Port.skipped_layout_tests): Ditto.
     45    (Port.expectations_dict): Ditto.
     46    (Port._port_specific_expectations_files): Ditto.
     47    (Port.expectations_files): Ditto.
     48    (Port.test_search_path): Ditto.
     49    (Port._tests_for_other_platforms): Ditto.
     50    * Scripts/webkitpy/port/base_unittest.py:
     51    (PortTest.test_additional_platform_directory): Accept, but do not use, device_type.
     52    (PortTest.test_nonexistant_expectations): Ditto.
     53    (test_ref_tests_platform_directory): Ditto.
     54    * Scripts/webkitpy/port/darwin.py:
     55    (DarwinPort._port_specific_expectations_files): Accept device_type.
     56    * Scripts/webkitpy/port/driver.py:
     57    (DriverProxy):
     58    (DriverProxy.host): Expose _target_host for device_type information.
     59    * Scripts/webkitpy/port/gtk.py:
     60    (GtkPort._port_specific_expectations_files): Accept, but do not use, device_type.
     61    * Scripts/webkitpy/port/ios.py:
     62    (IOSPort. default_baseline_search_path): Remove memoized, since it does not accept **kwargs.
     63    * Scripts/webkitpy/port/mac.py:
     64    (MacPort. default_baseline_search_path): Ditto.
     65    * Scripts/webkitpy/port/port_testcase.py:
     66    (TestWebKitPort._tests_for_other_platforms): Accept, but do not use, device_type.
     67    * Scripts/webkitpy/port/test.py:
     68    * Scripts/webkitpy/port/watch.py:
     69    (WatchPort. default_baseline_search_path): Remove memoized, since it does not accept **kwargs.
     70    * Scripts/webkitpy/port/win.py:
     71    (WinPort.test_search_path): Accept, but do not use, device_type.
     72    * Scripts/webkitpy/port/wpe.py:
     73    (WPEPort._port_specific_expectations_files): Ditto.
     74    * Scripts/webkitpy/tool/servers/rebaselineserver.py:
     75    (get_test_baselines.AllPlatformsPort.baseline_search_path): Ditto.
     76   
     77    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     78
     79    2019-01-15  Jonathan Bedard  <jbedard@apple.com>
     80
     81            webkitpy: Implement device type specific expected results (Part 1)
     82            https://bugs.webkit.org/show_bug.cgi?id=192162
     83
     84            Reviewed by Lucas Forschler.
     85
     86            Device type specific expected results covers two related ideas. The first (covered by this change)
     87            is where to search for -expected.* files. The second is which tests to run based on the
     88            TestExpectations.txt file.
     89
     90            After this change, the baseline search path will be determined by the type of device running a
     91            test. Device type will be passed into any function which picks a file based on the baseline search
     92            path.
     93
     94            * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
     95            (Worker._update_test_input): Pass device_type to self._port.reference_files(...).
     96            * Scripts/webkitpy/layout_tests/controllers/manager.py:
     97            (Manager.run): Print baseline search path for each round of devices.
     98            * Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
     99            (SingleTestRunner.__init__): Pass device_type into expected_*(...).
     100            (SingleTestRunner._expected_driver_output): Ditto.
     101            (SingleTestRunner._driver_input): Ditto.
     102            * Scripts/webkitpy/layout_tests/views/printing.py:
     103            (Printer.print_config): Move printing of baseline search path to a separate function.
     104            (Printer.print_baseline_search_path): Moved from Printer.print_config.
     105            * Scripts/webkitpy/layout_tests/views/printing_unittest.py:
     106            (Testprinter.test_print_config):
     107            (Testprinter.test_print_baseline_search_path):
     108            * Scripts/webkitpy/port/base.py:
     109            (Port.baseline_search_path): Pass device_type through.
     110            (Port._expected_baselines_for_suffixes): Ditto.
     111            (Port.expected_baselines): Ditto.
     112            (Port.expected_filename): Ditto.
     113            (Port.expected_checksum): Ditto.
     114            (Port.expected_image): Ditto.
     115            (Port.expected_audio): Ditto.
     116            (Port.expected_text): Ditto.
     117            (Port.reference_files): Ditto.
     118            (Port.tests): Ditto.
     119            (Port._expanded_paths): Ditto.
     120            (Port.skipped_layout_tests): Ditto.
     121            (Port.expectations_dict): Ditto.
     122            (Port._port_specific_expectations_files): Ditto.
     123            (Port.expectations_files): Ditto.
     124            (Port.test_search_path): Ditto.
     125            (Port._tests_for_other_platforms): Ditto.
     126            * Scripts/webkitpy/port/base_unittest.py:
     127            (PortTest.test_additional_platform_directory): Accept, but do not use, device_type.
     128            (PortTest.test_nonexistant_expectations): Ditto.
     129            (test_ref_tests_platform_directory): Ditto.
     130            * Scripts/webkitpy/port/darwin.py:
     131            (DarwinPort._port_specific_expectations_files): Accept device_type.
     132            * Scripts/webkitpy/port/driver.py:
     133            (DriverProxy):
     134            (DriverProxy.host): Expose _target_host for device_type information.
     135            * Scripts/webkitpy/port/gtk.py:
     136            (GtkPort._port_specific_expectations_files): Accept, but do not use, device_type.
     137            * Scripts/webkitpy/port/ios.py:
     138            (IOSPort. default_baseline_search_path): Remove memoized, since it does not accept **kwargs.
     139            * Scripts/webkitpy/port/mac.py:
     140            (MacPort. default_baseline_search_path): Ditto.
     141            * Scripts/webkitpy/port/port_testcase.py:
     142            (TestWebKitPort._tests_for_other_platforms): Accept, but do not use, device_type.
     143            * Scripts/webkitpy/port/test.py:
     144            * Scripts/webkitpy/port/watch.py:
     145            (WatchPort. default_baseline_search_path): Remove memoized, since it does not accept **kwargs.
     146            * Scripts/webkitpy/port/win.py:
     147            (WinPort.test_search_path): Accept, but do not use, device_type.
     148            * Scripts/webkitpy/port/wpe.py:
     149            (WPEPort._port_specific_expectations_files): Ditto.
     150            * Scripts/webkitpy/tool/servers/rebaselineserver.py:
     151            (get_test_baselines.AllPlatformsPort.baseline_search_path): Ditto.
     152
    11532019-04-02  Kocsen Chung  <kocsen_chung@apple.com>
    2154
  • branches/safari-607-branch/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py

    r235771 r243771  
    295295        if test_input.reference_files is None:
    296296            # Lazy initialization.
    297             test_input.reference_files = self._port.reference_files(test_input.test_name)
     297            test_input.reference_files = self._port.reference_files(test_input.test_name, device_type=self._port.target_host(self._worker_number).device_type)
    298298        if test_input.reference_files:
    299299            test_input.should_run_pixel_test = True
  • branches/safari-607-branch/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

    r238944 r243771  
    275275                    index += 1
    276276
     277            self._printer.print_baseline_search_path(device_type=device_type)
     278
    277279            _log.info('Running {}{}'.format(pluralize(len(tests), 'test'), ' for {}'.format(str(device_type)) if device_type else ''))
    278280            _log.info('')
  • branches/safari-607-branch/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py

    r217130 r243771  
    7070            # in either layout tests or reftests, but not in both.
    7171            for suffix in ('.txt', '.png', '.wav'):
    72                 expected_filename = self._port.expected_filename(self._test_name, suffix)
     72                expected_filename = self._port.expected_filename(self._test_name, suffix, device_type=self._driver.host.device_type)
    7373                if self._filesystem.exists(expected_filename):
    7474                    _log.error('%s is a reftest, but has an unused expectation file. Please remove %s.', self._test_name, expected_filename)
    7575
    7676    def _expected_driver_output(self):
    77         return DriverOutput(self._port.expected_text(self._test_name),
    78                                  self._port.expected_image(self._test_name),
    79                                  self._port.expected_checksum(self._test_name),
    80                                  self._port.expected_audio(self._test_name))
     77        return DriverOutput(self._port.expected_text(self._test_name, device_type=self._driver.host.device_type),
     78                                 self._port.expected_image(self._test_name, device_type=self._driver.host.device_type),
     79                                 self._port.expected_checksum(self._test_name, device_type=self._driver.host.device_type),
     80                                 self._port.expected_audio(self._test_name, device_type=self._driver.host.device_type))
    8181
    8282    def _should_fetch_expected_checksum(self):
     
    9090        image_hash = None
    9191        if self._should_fetch_expected_checksum():
    92             image_hash = self._port.expected_checksum(self._test_name)
     92            image_hash = self._port.expected_checksum(self._test_name, device_type=self._driver.host.device_type)
    9393        return DriverInput(self._test_name, self._timeout, image_hash, self._should_run_pixel_test, self._should_dump_jsconsolelog_in_stderr)
    9494
  • branches/safari-607-branch/Tools/Scripts/webkitpy/layout_tests/views/printing.py

    r238749 r243771  
    9898        self._print_default('')
    9999
     100    def print_baseline_search_path(self, device_type=None):
     101        fs = self._port.host.filesystem
     102        full_baseline_search_path = self._port.baseline_search_path(device_type=device_type)
     103        normalize_baseline = lambda baseline_search_path: [
     104            fs.relpath(x, self._port.layout_tests_dir()).replace("../", "") for x in baseline_search_path]
     105
     106        self._print_default('Verbose baseline search path: {} -> generic'.format(
     107            ' -> '.join(normalize_baseline(full_baseline_search_path))))
     108
     109        self._print_default('')
     110        self._print_default('Baseline search path: {} -> generic'.format(
     111            ' -> '.join(normalize_baseline([path for path in full_baseline_search_path if fs.exists(path)]))))
     112        self._print_default('')
     113
    100114    def print_found(self, num_all_test_files, num_to_run, repeat_each, iterations):
    101115        found_str = 'Found %s; running %d' % (grammar.pluralize(num_all_test_files, "test"), num_to_run)
  • branches/safari-607-branch/Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py

    r202819 r243771  
    118118        self.assertIn('Regular timeout: ', err.getvalue())
    119119
     120    def test_print_baseline_search_path(self):
     121        printer, err = self.get_printer()
     122        printer.print_baseline_search_path()
     123
     124        self.assertIn('Verbose baseline search path: platform/test-mac-leopard -> platform/test-mac-snowleopard -> generic', err.getvalue())
     125        self.assertIn('Baseline search path: platform/test-mac-leopard -> generic', err.getvalue())
     126
    120127        self.reset(err)
    121128        printer._options.quiet = True
    122         printer.print_config('/tmp')
     129        printer.print_baseline_search_path()
    123130        self.assertNotIn('Baseline search path: platform/test-mac-leopard -> platform/test-mac-snowleopard -> generic', err.getvalue())
    124131
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/base.py

    r243769 r243771  
    211211        return baseline_search_paths[0]
    212212
    213     def baseline_search_path(self):
    214         return self.get_option('additional_platform_directory', []) + self._compare_baseline() + self.default_baseline_search_path()
     213    def baseline_search_path(self, device_type=None):
     214        return self.get_option('additional_platform_directory', []) + self._compare_baseline() + self.default_baseline_search_path(device_type=device_type)
    215215
    216216    def default_baseline_search_path(self, device_type=None):
     
    411411        return ('.wav', '.webarchive', '.txt', '.png')
    412412
    413     def _expected_baselines_for_suffixes(self, test_name, suffixes, all_baselines=False):
    414         baseline_search_path = self.baseline_search_path() + [self.layout_tests_dir()]
     413    def _expected_baselines_for_suffixes(self, test_name, suffixes, all_baselines=False, device_type=None):
     414        baseline_search_path = self.baseline_search_path(device_type=device_type) + [self.layout_tests_dir()]
    415415
    416416        baselines = []
     
    431431        return baselines
    432432
    433     def expected_baselines(self, test_name, suffix, all_baselines=False):
     433    def expected_baselines(self, test_name, suffix, all_baselines=False, device_type=None):
    434434        """Given a test name, finds where the baseline results are located.
    435435
     
    458458        platform specific.
    459459        """
    460         return self._expected_baselines_for_suffixes(test_name, [suffix], all_baselines=all_baselines)
    461 
    462     def expected_filename(self, test_name, suffix, return_default=True):
     460        return self._expected_baselines_for_suffixes(test_name, [suffix], all_baselines=all_baselines, device_type=device_type)
     461
     462    def expected_filename(self, test_name, suffix, return_default=True, device_type=None):
    463463        """Given a test name, returns an absolute path to its expected results.
    464464
     
    480480        the other baseline and filename manipulation routines.
    481481        """
    482         platform_dir, baseline_filename = self.expected_baselines(test_name, suffix)[0]
     482        platform_dir, baseline_filename = self.expected_baselines(test_name, suffix, device_type=device_type)[0]
    483483        if platform_dir or return_default:
    484484            return self._filesystem.join(platform_dir or self.layout_tests_dir(), baseline_filename)
    485485        return None
    486486
    487     def expected_checksum(self, test_name):
     487    def expected_checksum(self, test_name, device_type=None):
    488488        """Returns the checksum of the image we expect the test to produce, or None if it is a text-only test."""
    489         png_path = self.expected_filename(test_name, '.png')
     489        png_path = self.expected_filename(test_name, '.png', device_type=device_type)
    490490
    491491        if self._filesystem.exists(png_path):
     
    495495        return None
    496496
    497     def expected_image(self, test_name):
     497    def expected_image(self, test_name, device_type=None):
    498498        """Returns the image we expect the test to produce."""
    499         baseline_path = self.expected_filename(test_name, '.png')
     499        baseline_path = self.expected_filename(test_name, '.png', device_type=device_type)
    500500        if not self._filesystem.exists(baseline_path):
    501501            return None
    502502        return self._filesystem.read_binary_file(baseline_path)
    503503
    504     def expected_audio(self, test_name):
    505         baseline_path = self.expected_filename(test_name, '.wav')
     504    def expected_audio(self, test_name, device_type=None):
     505        baseline_path = self.expected_filename(test_name, '.wav', device_type=device_type)
    506506        if not self._filesystem.exists(baseline_path):
    507507            return None
    508508        return self._filesystem.read_binary_file(baseline_path)
    509509
    510     def expected_text(self, test_name):
     510    def expected_text(self, test_name, device_type=None):
    511511        """Returns the text output we expect the test to produce, or None
    512512        if we don't expect there to be any text output.
     
    515515        # output from DRT (instead treating it as a binary string), we read the
    516516        # baselines as a binary string, too.
    517         baseline_path = self.expected_filename(test_name, '.txt')
     517        baseline_path = self.expected_filename(test_name, '.txt', device_type=device_type)
    518518        if not self._filesystem.exists(baseline_path):
    519             baseline_path = self.expected_filename(test_name, '.webarchive')
     519            baseline_path = self.expected_filename(test_name, '.webarchive', device_type=device_type)
    520520            if not self._filesystem.exists(baseline_path):
    521521                return None
     
    546546        return parsed_list
    547547
    548     def reference_files(self, test_name):
     548    def reference_files(self, test_name, device_type=None):
    549549        """Return a list of expectation (== or !=) and filename pairs"""
    550550
     
    561561            for part2 in self._supported_reference_extensions:
    562562                suffixes.append(part1 + part2)
    563         for platform_dir, baseline_filename in self._expected_baselines_for_suffixes(test_name, suffixes):
     563        for platform_dir, baseline_filename in self._expected_baselines_for_suffixes(test_name, suffixes, device_type=device_type):
    564564            if not platform_dir:
    565565                continue
     
    582582        return [self.host.filesystem.relpath(test, self.layout_tests_dir()) for test in self._filesystem.glob(re.sub('-expected.*', '.*', self._filesystem.join(self.layout_tests_dir(), path))) if self._filesystem.isfile(test)]
    583583
    584     def tests(self, paths):
     584    def tests(self, paths, device_type=None):
    585585        """Return the list of tests found. Both generic and platform-specific tests matching paths should be returned."""
    586         expanded_paths = self._expanded_paths(paths)
     586        expanded_paths = self._expanded_paths(paths, device_type=device_type)
    587587        return self._real_tests(expanded_paths)
    588588
    589     def _expanded_paths(self, paths):
     589    def _expanded_paths(self, paths, device_type=None):
    590590        expanded_paths = []
    591591        fs = self._filesystem
     
    595595            if self.test_isdir(path) and not path.startswith('platform') and not fs.isabs(path):
    596596                for platform_dir in all_platform_dirs:
    597                     if fs.isdir(fs.join(platform_dir, path)) and platform_dir in self.baseline_search_path():
     597                    if fs.isdir(fs.join(platform_dir, path)) and platform_dir in self.baseline_search_path(device_type=device_type):
    598598                        expanded_paths.append(self.relative_test_filename(fs.join(platform_dir, path)))
    599599
     
    756756        return self._webkit_finder.perf_tests_dir()
    757757
    758     def skipped_layout_tests(self, test_list):
     758    def skipped_layout_tests(self, test_list, device_type=None):
    759759        """Returns tests skipped outside of the TestExpectations files."""
    760         return set(self._tests_for_other_platforms()).union(self._skipped_tests_for_unsupported_features(test_list))
     760        return set(self._tests_for_other_platforms(device_type=device_type)).union(self._skipped_tests_for_unsupported_features(test_list))
    761761
    762762    @memoized
     
    11621162        return False
    11631163
    1164     def expectations_dict(self):
     1164    def expectations_dict(self, device_type=None):
    11651165        """Returns an OrderedDict of name -> expectations strings.
    11661166        The names are expected to be (but not required to be) paths in the filesystem.
     
    11731173        expectations = OrderedDict()
    11741174
    1175         for path in self.expectations_files():
     1175        for path in self.expectations_files(device_type=device_type):
    11761176            if self._filesystem.exists(path):
    11771177                expectations[path] = self._filesystem.read_text_file(path)
     
    11861186        return expectations
    11871187
    1188     def _port_specific_expectations_files(self):
     1188    def _port_specific_expectations_files(self, **kwargs):
    11891189        # Unlike baseline_search_path, we only want to search [WK2-PORT, PORT-VERSION, PORT] and any directories
    11901190        # included via --additional-platform-directory, not the full casade.
     
    12041204        return [self._filesystem.join(self._webkit_baseline_path(d), 'TestExpectations') for d in search_paths]
    12051205
    1206     def expectations_files(self):
    1207         return [self.path_to_generic_test_expectations_file()] + self._port_specific_expectations_files()
     1206    def expectations_files(self, device_type=None):
     1207        return [self.path_to_generic_test_expectations_file()] + self._port_specific_expectations_files(device_type=device_type)
    12081208
    12091209    def repository_paths(self):
     
    15371537        return []
    15381538
    1539     def test_search_path(self):
    1540         return self.baseline_search_path()
    1541 
    1542     def _tests_for_other_platforms(self):
     1539    def test_search_path(self, device_type=None):
     1540        return self.baseline_search_path(device_type=device_type)
     1541
     1542    def _tests_for_other_platforms(self, device_type=None):
    15431543        # By default we will skip any directory under LayoutTests/platform
    15441544        # that isn't in our baseline search path (this mirrors what
     
    15481548        dirs_to_skip = []
    15491549        for entry in entries:
    1550             if self._filesystem.isdir(entry) and entry not in self.test_search_path():
     1550            if self._filesystem.isdir(entry) and entry not in self.test_search_path(device_type=device_type):
    15511551                basename = self._filesystem.basename(entry)
    15521552                dirs_to_skip.append('platform/%s' % basename)
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/base_unittest.py

    r239048 r243771  
    162162    def test_additional_platform_directory(self):
    163163        port = self.make_port(port_name='foo')
    164         port.default_baseline_search_path = lambda: ['LayoutTests/platform/foo']
     164        port.default_baseline_search_path = lambda **kwargs: ['LayoutTests/platform/foo']
    165165        test_file = 'fast/test.html'
    166166
     
    188188    def test_nonexistant_expectations(self):
    189189        port = self.make_port(port_name='foo')
    190         port.expectations_files = lambda: ['/mock-checkout/LayoutTests/platform/exists/TestExpectations', '/mock-checkout/LayoutTests/platform/nonexistant/TestExpectations']
     190        port.expectations_files = lambda **kwargs: ['/mock-checkout/LayoutTests/platform/exists/TestExpectations', '/mock-checkout/LayoutTests/platform/nonexistant/TestExpectations']
    191191        port._filesystem.write_text_file('/mock-checkout/LayoutTests/platform/exists/TestExpectations', '')
    192192        self.assertEqual('\n'.join(port.expectations_dict().keys()), '/mock-checkout/LayoutTests/platform/exists/TestExpectations')
     
    414414    def test_ref_tests_platform_directory(self):
    415415        port = self.make_port(port_name='foo')
    416         port.default_baseline_search_path = lambda: ['/mock-checkout/LayoutTests/platform/foo']
     416        port.default_baseline_search_path = lambda **kwargs: ['/mock-checkout/LayoutTests/platform/foo']
    417417        port._filesystem.write_text_file('/mock-checkout/LayoutTests/fast/ref-expected.html', 'foo')
    418418
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/darwin.py

    r229085 r243771  
    5454        return super(DarwinPort, self).default_timeout_ms()
    5555
    56     def _port_specific_expectations_files(self):
    57         return list(reversed([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in self.baseline_search_path()]))
     56    def _port_specific_expectations_files(self, device_type=None):
     57        return list(reversed([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in self.baseline_search_path(device_type=device_type)]))
    5858
    5959    def check_for_leaks(self, process_name, process_pid):
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/driver.py

    r235467 r243771  
    720720        return self._driver_instance_constructor(self._port, self._worker_number, pixel_tests, self._no_timeout)
    721721
     722    @property
     723    def host(self):
     724        return self._driver._target_host
     725
    722726    # FIXME: this should be a @classmethod (or implemented on Port instead).
    723727    def is_http_test(self, test_name):
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/gtk.py

    r243769 r243771  
    214214        return map(self._webkit_baseline_path, self._search_paths())
    215215
    216     def _port_specific_expectations_files(self):
     216    def _port_specific_expectations_files(self, **kwargs):
    217217        return [self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in reversed(self._search_paths())]
    218218
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/ios.py

    r243769 r243771  
    5353        return VersionNameMap.map(self.host.platform).to_name(self._os_version, platform=IOSPort.port_name)
    5454
    55     @memoized
    5655    def default_baseline_search_path(self, device_type=None):
    5756        wk_string = 'wk1'
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/mac.py

    r243769 r243771  
    7070        return ['ARCHS=i386'] if self.architecture() == 'x86' else []
    7171
    72     @memoized
    7372    def default_baseline_search_path(self, **kwargs):
    7473        versions_to_fallback = []
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/port_testcase.py

    r238944 r243771  
    7171        return self.symbols_string
    7272
    73     def _tests_for_other_platforms(self):
     73    def _tests_for_other_platforms(self, **kwargs):
    7474        return ["media", ]
    7575
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/test.py

    r238903 r243771  
    408408        return 'MOCK _path_to_driver'
    409409
    410     def baseline_search_path(self):
     410    def baseline_search_path(self, **kwargs):
    411411        search_paths = {
    412412            'test-mac-snowleopard': ['test-mac-snowleopard'],
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/watch.py

    r243769 r243771  
    5959        return 4
    6060
    61     @memoized
    6261    def default_baseline_search_path(self, **kwargs):
    6362        versions_to_fallback = []
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/win.py

    r243769 r243771  
    218218        return {binary.split('.')[0]: self._build_path(binary) for binary in self.API_TEST_BINARY_NAMES}
    219219
    220     def test_search_path(self):
     220    def test_search_path(self, **kwargs):
    221221        test_fallback_names = [path for path in self.baseline_search_path() if not path.startswith(self._webkit_baseline_path('mac'))]
    222222        return map(self._webkit_baseline_path, test_fallback_names)
  • branches/safari-607-branch/Tools/Scripts/webkitpy/port/wpe.py

    r243769 r243771  
    106106        return map(self._webkit_baseline_path, self._search_paths())
    107107
    108     def _port_specific_expectations_files(self):
     108    def _port_specific_expectations_files(self, **kwargs):
    109109        return map(lambda x: self._filesystem.join(self._webkit_baseline_path(x), 'TestExpectations'), reversed(self._search_paths()))
    110110
  • branches/safari-607-branch/Tools/Scripts/webkitpy/tool/servers/rebaselineserver.py

    r225733 r243771  
    169169            self._platforms_by_directory = dict([(self._webkit_baseline_path(p), p) for p in test_config.platforms])
    170170
    171         def baseline_search_path(self):
     171        def baseline_search_path(self, **kwargs):
    172172            return self._platforms_by_directory.keys()
    173173
Note: See TracChangeset for help on using the changeset viewer.