Changeset 90520 in webkit


Ignore:
Timestamp:
Jul 6, 2011, 6:22:31 PM (14 years ago)
Author:
dpranke@chromium.org
Message:

2011-07-06 Dirk Pranke <dpranke@chromium.org>

Reviewed by Eric Siedel.

nrwt: make the code be consistent about using test names instead of filenames or paths

https://bugs.webkit.org/show_bug.cgi?id=63597

It can be hard to figure out where in the code we're assuming
test names are listed as unix-style relative filenames and where
they are either absolute paths or relative paths following the
host filesystem convention.

This patch changes things so that everything outside of the
Port object uses (and must assume) unix-style relative
filenames (with one exception, which is specifying host-local
filenames as a list of test arguments on the command line).

This should make things clearer and more consistent, and also
removes a lot of path conversion calls.

The changes in this patch outside of port/base.py are largely
cosmetic changes of "filename" to "test". We add a few routines
to the base Port implementation to manipulate test names to
split them, figure out if we're referring to a directory of
tests, etc.

  • Scripts/webkitpy/common/net/layouttestresults.py:
  • Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
  • Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
  • Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
  • Scripts/webkitpy/layout_tests/layout_package/manager.py:
  • Scripts/webkitpy/layout_tests/layout_package/manager_unittest.py:
  • Scripts/webkitpy/layout_tests/layout_package/printing.py:
  • Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
  • Scripts/webkitpy/layout_tests/layout_package/result_summary.py:
  • Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_input.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_result_writer.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_results.py:
  • Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py:
  • Scripts/webkitpy/layout_tests/layout_package/worker.py:
  • Scripts/webkitpy/layout_tests/port/base.py:
  • Scripts/webkitpy/layout_tests/port/base_unittest.py:
  • Scripts/webkitpy/layout_tests/port/chromium.py:
  • Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
  • Scripts/webkitpy/layout_tests/port/dryrun.py:
  • Scripts/webkitpy/layout_tests/port/test.py:
  • Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
  • Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
  • Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py:
  • Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py:
  • Scripts/webkitpy/tool/bot/flakytestreporter.py:
  • Scripts/webkitpy/tool/commands/rebaseline.py:
  • Scripts/webkitpy/tool/commands/rebaselineserver.py:
Location:
trunk/Tools
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r90519 r90520  
     12011-07-06  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Eric Siedel.
     4
     5        nrwt: make the code be consistent about using test names instead of filenames or paths
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=63597
     8
     9        It can be hard to figure out where in the code we're assuming
     10        test names are listed as unix-style relative filenames and where
     11        they are either absolute paths or relative paths following the
     12        host filesystem convention.
     13
     14        This patch changes things so that everything outside of the
     15        Port object uses (and must assume) unix-style relative
     16        filenames (with one exception, which is specifying host-local
     17        filenames as a list of test arguments on the command line).
     18
     19        This should make things clearer and more consistent, and also
     20        removes a lot of path conversion calls.
     21
     22        The changes in this patch outside of port/base.py are largely
     23        cosmetic changes of "filename" to "test". We add a few routines
     24        to the base Port implementation to manipulate test names to
     25        split them, figure out if we're referring to a directory of
     26        tests, etc.
     27
     28        * Scripts/webkitpy/common/net/layouttestresults.py:
     29        * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
     30        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
     31        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
     32        * Scripts/webkitpy/layout_tests/layout_package/manager.py:
     33        * Scripts/webkitpy/layout_tests/layout_package/manager_unittest.py:
     34        * Scripts/webkitpy/layout_tests/layout_package/printing.py:
     35        * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
     36        * Scripts/webkitpy/layout_tests/layout_package/result_summary.py:
     37        * Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py:
     38        * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
     39        * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
     40        * Scripts/webkitpy/layout_tests/layout_package/test_input.py:
     41        * Scripts/webkitpy/layout_tests/layout_package/test_result_writer.py:
     42        * Scripts/webkitpy/layout_tests/layout_package/test_results.py:
     43        * Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py:
     44        * Scripts/webkitpy/layout_tests/layout_package/worker.py:
     45        * Scripts/webkitpy/layout_tests/port/base.py:
     46        * Scripts/webkitpy/layout_tests/port/base_unittest.py:
     47        * Scripts/webkitpy/layout_tests/port/chromium.py:
     48        * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
     49        * Scripts/webkitpy/layout_tests/port/dryrun.py:
     50        * Scripts/webkitpy/layout_tests/port/test.py:
     51        * Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
     52        * Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
     53        * Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py:
     54        * Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py:
     55        * Scripts/webkitpy/tool/bot/flakytestreporter.py:
     56        * Scripts/webkitpy/tool/commands/rebaseline.py:
     57        * Scripts/webkitpy/tool/commands/rebaselineserver.py:
     58
    1592011-07-06  Chris Guillory  <ctguil@chromium.org>
    260
  • trunk/Tools/Scripts/webkitpy/common/net/layouttestresults.py

    r90055 r90520  
    173173
    174174    def failing_tests(self):
    175         return [result.filename for result in self.failing_test_results()]
     175        return [result.test_name for result in self.failing_test_results()]
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py

    r90024 r90520  
    7272        self._expectations = expectations
    7373
    74         # We want relative paths to LayoutTest root for JSON output.
    75         path_to_name = self._get_path_relative_to_layout_test_root
    7674        self._result_summary = result_summary
    77         self._failures = dict(
    78             (path_to_name(test), test_failures.determine_result_type(failures))
    79             for (test, failures) in result_summary.failures.iteritems())
    80         self._all_tests = [path_to_name(test) for test in all_tests]
    81         self._test_timings = dict(
    82             (path_to_name(test_tuple.filename), test_tuple.test_run_time)
    83             for test_tuple in test_timings)
     75        self._failures = dict((test_name, test_failures.determine_result_type(failures))
     76            for (test_name, failures) in result_summary.failures.iteritems())
     77        self._all_tests = all_tests
     78        self._test_timings = dict((test_tuple.test_name, test_tuple.test_run_time) for test_tuple in test_timings)
    8479
    8580        self.generate_json_output()
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py

    r90024 r90520  
    6969
    7070def test_timings_trie(port, individual_test_timings):
    71     """Breaks a filename into chunks by directory and puts the test time as a value in the lowest part, e.g.
     71    """Breaks a test name into chunks by directory and puts the test time as a value in the lowest part, e.g.
    7272    foo/bar/baz.html: 1ms
    7373    foo/bar/baz1.html: 3ms
     
    8383    trie = {}
    8484    for test_result in individual_test_timings:
    85         try:
    86             test = port.relative_test_filename(test_result.filename)
    87         except AssertionError:
    88             # FIXME: Handle this better. Non-layout tests shouldn't be relativized.
    89             test = test_result.filename
     85        test = test_result.test_name
    9086
    9187        parts = test.split('/')
     
    108104    (NONE, FAILS, FLAKY, DISABLED) = range(4)
    109105
    110     def __init__(self, name, failed=False, elapsed_time=0):
    111         # FIXME: s/filename/name to be consistent with the rest of layout_package.
    112         self.filename = name
     106    def __init__(self, test, failed=False, elapsed_time=0):
     107        self.test_name = test
    113108        self.failed = failed
    114109        self.test_run_time = elapsed_time
    115110
    116         test_name = name
     111        test_name = test
    117112        try:
    118             test_name = name.split('.')[1]
     113            test_name = test.split('.')[1]
    119114        except IndexError:
    120             _log.warn("Invalid test name: %s.", name)
     115            _log.warn("Invalid test name: %s.", test)
    121116            pass
    122117
     
    321316    def _get_failed_test_names(self):
    322317        """Returns a set of failed test names."""
    323         return set([r.filename for r in self._test_results if r.failed])
     318        return set([r.test_name for r in self._test_results if r.failed])
    324319
    325320    def _get_modifier_char(self, test_name):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py

    r90024 r90520  
    8686
    8787        port = Mock()
    88         port.relative_test_filename = lambda filename: filename
    8988        port._filesystem = filesystem_mock.MockFileSystem()
    9089        generator = json_results_generator.JSONResultsGeneratorBase(port,
     
    201200        test_port = test.TestPort()
    202201        individual_test_timings = []
    203         individual_test_timings.append(json_results_generator.TestResult('/test.checkout/LayoutTests/foo/bar/baz.html', elapsed_time=1.2))
    204         individual_test_timings.append(json_results_generator.TestResult('/test.checkout/LayoutTests/bar.html', elapsed_time=0.0001))
     202        individual_test_timings.append(json_results_generator.TestResult('foo/bar/baz.html', elapsed_time=1.2))
     203        individual_test_timings.append(json_results_generator.TestResult('bar.html', elapsed_time=0.0001))
    205204        trie = json_results_generator.test_timings_trie(test_port, individual_test_timings)
    206        
     205
    207206        expected_trie = {
    208207          'bar.html': 0,
     
    213212          }
    214213        }
    215        
     214
    216215        self.assertEqual(simplejson.dumps(trie), simplejson.dumps(expected_trie))
    217        
    218        
     216
     217
    219218
    220219if __name__ == '__main__':
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager.py

    r90419 r90520  
    122122    original_results = result_summary.unexpected_results if only_unexpected else result_summary.results
    123123
    124     for filename, result in original_results.iteritems():
     124    for test_name, result in original_results.iteritems():
    125125        # Note that if a test crashed in the original run, we ignore
    126126        # whether or not it crashed when we retried it (if we retried it),
    127127        # and always consider the result not flaky.
    128         test = port_obj.relative_test_filename(filename)
    129         expected = expectations.get_expectations_string(filename)
     128        expected = expectations.get_expectations_string(test_name)
    130129        result_type = result.type
    131130        actual = [keywords[result_type]]
     
    145144        elif result_type == test_expectations.CRASH:
    146145            num_regressions += 1
    147         elif filename in result_summary.unexpected_results:
    148             if filename not in retry_summary.unexpected_results:
    149                 actual.extend(expectations.get_expectations_string(filename).split(" "))
     146        elif test_name in result_summary.unexpected_results:
     147            if test_name not in retry_summary.unexpected_results:
     148                actual.extend(expectations.get_expectations_string(test_name).split(" "))
    150149                num_flaky += 1
    151150            else:
    152                 retry_result_type = retry_summary.unexpected_results[filename].type
     151                retry_result_type = retry_summary.unexpected_results[test_name].type
    153152                if result_type != retry_result_type:
    154153                    actual.append(keywords[retry_result_type])
     
    195194        #     }
    196195        # }
    197         parts = test.split('/')
     196        parts = test_name.split('/')
    198197        current_map = tests
    199198        for i, part in enumerate(parts):
     
    277276        self._message_broker = None
    278277
    279         self.HTTP_SUBDIR = self._fs.join('', 'http', '')
    280         self.WEBSOCKET_SUBDIR = self._fs.join('', 'websocket', '')
    281         self.LAYOUT_TESTS_DIRECTORY = "LayoutTests" + self._fs.sep
     278        self.HTTP_SUBDIR = port.TEST_PATH_SEPARATOR + 'http' + port.TEST_PATH_SEPARATOR
     279        self.WEBSOCKET_SUBDIR = port.TEST_PATH_SEPARATOR + 'websocket' + port.TEST_PATH_SEPARATOR
     280        self.LAYOUT_TESTS_DIRECTORY = 'LayoutTests'
    282281        self._has_http_lock = False
    283282
     
    313312        paths += last_unexpected_results
    314313        if self._options.test_list:
    315             paths += self._strip_test_dir_prefixes(read_test_files(self._fs, self._options.test_list))
     314            paths += self._strip_test_dir_prefixes(read_test_files(self._fs, self._options.test_list, self._port.TEST_PATH_SEPARATOR))
    316315        self._test_files = self._port.tests(paths)
    317316
     
    320319
    321320    def _strip_test_dir_prefix(self, path):
    322         if path.startswith(self.LAYOUT_TESTS_DIRECTORY):
    323             return path[len(self.LAYOUT_TESTS_DIRECTORY):]
     321        # Handle both "LayoutTests/foo/bar.html" and "LayoutTests\foo\bar.html" if
     322        # the filesystem uses '\\' as a directory separator.
     323        if path.startswith(self.LAYOUT_TESTS_DIRECTORY + self._port.TEST_PATH_SEPARATOR):
     324            return path[len(self.LAYOUT_TESTS_DIRECTORY + self._port.TEST_PATH_SEPARATOR):]
     325        if path.startswith(self.LAYOUT_TESTS_DIRECTORY + self._fs.sep):
     326            return path[len(self.LAYOUT_TEST_DIRECTORY + self._fs.sep):]
    324327        return path
    325328
     
    394397            random.shuffle(self._test_files_list)
    395398        else:
    396             self._test_files_list.sort(key=lambda path: path_key(self._fs, path))
     399            self._test_files_list.sort(key=lambda test: test_key(self._port, test))
    397400
    398401        # If the user specifies they just want to run a subset of the tests,
     
    512515        """Returns the highest-level directory by which to shard the given
    513516        test file."""
    514         index = test_file.rfind(self._fs.sep + self.LAYOUT_TESTS_DIRECTORY)
    515 
    516         test_file = test_file[index + len(self.LAYOUT_TESTS_DIRECTORY):]
    517         test_file_parts = test_file.split(self._fs.sep, 1)
    518         directory = test_file_parts[0]
    519         test_file = test_file_parts[1]
     517        directory, test_file = self._port.split_test(test_file)
    520518
    521519        # The http tests are very stable on mac/linux.
     
    523521        # turn shard the http tests there as well. Switching to apache is
    524522        # what made them stable on linux/mac.
    525         return_value = directory
    526         while ((directory != 'http' or sys.platform == 'darwin' or sys.platform.startswith('linux'))
    527                 and test_file.find(self._fs.sep) >= 0):
    528             test_file_parts = test_file.split(self._fs.sep, 1)
    529             directory = test_file_parts[0]
    530             return_value = self._fs.join(return_value, directory)
    531             test_file = test_file_parts[1]
    532 
    533         return return_value
     523        return directory
    534524
    535525    def _get_test_input_for_file(self, test_file):
     
    544534        """Return True if the test needs to be locked when
    545535        running multiple copies of NRWTs."""
    546         split_path = test_file.split(self._port._filesystem.sep)
     536        split_path = test_file.split(self._port.TEST_PATH_SEPARATOR)
    547537        return 'http' in split_path or 'websocket' in split_path
    548538
    549539    def _test_is_slow(self, test_file):
    550         return self._expectations.has_modifier(test_file,
    551                                                test_expectations.SLOW)
     540        return self._expectations.has_modifier(test_file, test_expectations.SLOW)
    552541
    553542    def _shard_tests(self, test_files, num_workers, fully_parallel):
     
    1009998            result_summary.add(result, expected=True)
    1010999        else:
    1011             expected = self._expectations.matches_an_expected_result(result.filename, result.type, self._options.pixel_tests)
     1000            expected = self._expectations.matches_an_expected_result(result.test_name, result.type, self._options.pixel_tests)
    10121001            result_summary.add(result, expected)
    1013             exp_str = self._expectations.get_expectations_string(result.filename)
     1002            exp_str = self._expectations.get_expectations_string(result.test_name)
    10141003            got_str = self._expectations.expectation_to_string(result.type)
    10151004            self._printer.print_test_result(result, expected, exp_str, got_str)
     
    12201209        unexpected_slow_tests = []
    12211210        for test_tuple in individual_test_timings:
    1222             filename = test_tuple.filename
     1211            test_name = test_tuple.test_name
    12231212            is_timeout_crash_or_slow = False
    1224             if self._test_is_slow(filename):
     1213            if self._test_is_slow(test_name):
    12251214                is_timeout_crash_or_slow = True
    12261215                slow_tests.append(test_tuple)
    12271216
    1228             if filename in result_summary.failures:
    1229                 result = result_summary.results[filename].type
     1217            if test_name in result_summary.failures:
     1218                result = result_summary.results[test_name].type
    12301219                if (result == test_expectations.TIMEOUT or
    12311220                    result == test_expectations.CRASH):
     
    12611250        self._printer.print_timing(title)
    12621251        for test_tuple in test_list:
    1263             filename = test_tuple.filename[len(
    1264                 self._port.layout_tests_dir()) + 1:]
    1265             filename = filename.replace('\\', '/')
    12661252            test_run_time = round(test_tuple.test_run_time, 1)
    1267             self._printer.print_timing("  %s took %s seconds" %
    1268                                        (filename, test_run_time))
     1253            self._printer.print_timing("  %s took %s seconds" % (test_tuple.test_name, test_run_time))
    12691254
    12701255    def _print_directory_timings(self, directory_test_timings):
     
    14201405    def handle_started_test(self, source, test_info, hang_timeout):
    14211406        worker_state = self._worker_states[source]
    1422         worker_state.current_test_name = self._port.relative_test_filename(test_info.filename)
     1407        worker_state.current_test_name = test_info.test_name
    14231408        worker_state.next_timeout = time.time() + hang_timeout
    14241409
     
    14701455            _log.error('    %s' % text)
    14711456
    1472 def read_test_files(fs, files):
     1457
     1458def read_test_files(fs, files, test_path_separator):
    14731459    tests = []
    14741460    for file in files:
    14751461        try:
     1462            if test_path_separator != fs.sep:
     1463                file = file.replace(test_path_separator, fs.sep)
    14761464            file_contents = fs.read_text_file(file).split('\n')
    14771465            for line in file_contents:
     
    14891477# FIXME: These two free functions belong either on manager (since it's the only one
    14901478# which uses them) or in a different file (if they need to be re-used).
    1491 def path_key(filesystem, path):
    1492     """Turns a path into a list with two sublists, the natural key of the
     1479def test_key(port, test_name):
     1480    """Turns a test name into a list with two sublists, the natural key of the
    14931481    dirname, and the natural key of the basename.
    14941482
     
    14961484    directory are kept together rather than being mixed in with files in
    14971485    subdirectories."""
    1498     dirname, basename = filesystem.split(path)
    1499     return (natural_sort_key(dirname + filesystem.sep), natural_sort_key(basename))
     1486    dirname, basename = port.split_test(test_name)
     1487    return (natural_sort_key(dirname + port.TEST_PATH_SEPARATOR), natural_sort_key(basename))
    15001488
    15011489
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/manager_unittest.py

    r90419 r90520  
    3737from webkitpy.common.system import outputcapture
    3838from webkitpy.thirdparty.mock import Mock
     39from webkitpy import layout_tests
     40from webkitpy.layout_tests import port
    3941
    4042from webkitpy import layout_tests
    4143from webkitpy.layout_tests import run_webkit_tests
    42 from webkitpy.layout_tests.layout_package.manager import Manager, natural_sort_key, path_key, TestRunInterruptedException, TestShard
     44from webkitpy.layout_tests.layout_package.manager import Manager, natural_sort_key, test_key, TestRunInterruptedException, TestShard
    4345from webkitpy.layout_tests.layout_package import printing
    4446from webkitpy.layout_tests.layout_package.result_summary import ResultSummary
     
    5254
    5355class ShardingTests(unittest.TestCase):
    54     # FIXME: Remove "LayoutTests" from this if we can ever convert the generic
    55     # code from filenames to test names.
    5656    test_list = [
    57         "LayoutTests/http/tests/websocket/tests/unicode.htm",
    58         "LayoutTests/animations/keyframes.html",
    59         "LayoutTests/http/tests/security/view-source-no-refresh.html",
    60         "LayoutTests/http/tests/websocket/tests/websocket-protocol-ignored.html",
    61         "LayoutTests/fast/css/display-none-inline-style-change-crash.html",
    62         "LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html",
    63         "LayoutTests/dom/html/level2/html/HTMLAnchorElement03.html",
    64         "LayoutTests/ietestcenter/Javascript/11.1.5_4-4-c-1.html",
    65         "LayoutTests/dom/html/level2/html/HTMLAnchorElement06.html",
     57        "http/tests/websocket/tests/unicode.htm",
     58        "animations/keyframes.html",
     59        "http/tests/security/view-source-no-refresh.html",
     60        "http/tests/websocket/tests/websocket-protocol-ignored.html",
     61        "fast/css/display-none-inline-style-change-crash.html",
     62        "http/tests/xmlhttprequest/supported-xml-content-types.html",
     63        "dom/html/level2/html/HTMLAnchorElement03.html",
     64        "ietestcenter/Javascript/11.1.5_4-4-c-1.html",
     65        "dom/html/level2/html/HTMLAnchorElement06.html",
    6666    ]
    6767
    6868    def get_shards(self, num_workers, fully_parallel):
    69         port = Mock()
     69        port = layout_tests.port.get(port_name='test')
    7070        port._filesystem = filesystem_mock.MockFileSystem()
    7171        self.manager = ManagerWrapper(port=port, options=Mock(), printer=Mock())
     
    8080        self.assertEquals(locked,
    8181            [TestShard('locked_shard_1',
    82               ['LayoutTests/http/tests/security/view-source-no-refresh.html',
    83                'LayoutTests/http/tests/websocket/tests/unicode.htm',
    84                'LayoutTests/http/tests/websocket/tests/websocket-protocol-ignored.html',
    85                'LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html'])])
     82              ['http/tests/security/view-source-no-refresh.html',
     83               'http/tests/websocket/tests/unicode.htm',
     84               'http/tests/websocket/tests/websocket-protocol-ignored.html',
     85               'http/tests/xmlhttprequest/supported-xml-content-types.html'])])
    8686        self.assertEquals(unlocked,
    8787            [TestShard('animations',
    88                        ['LayoutTests/animations/keyframes.html']),
     88                       ['animations/keyframes.html']),
    8989             TestShard('dom/html/level2/html',
    90                        ['LayoutTests/dom/html/level2/html/HTMLAnchorElement03.html',
    91                         'LayoutTests/dom/html/level2/html/HTMLAnchorElement06.html']),
     90                       ['dom/html/level2/html/HTMLAnchorElement03.html',
     91                        'dom/html/level2/html/HTMLAnchorElement06.html']),
    9292             TestShard('fast/css',
    93                        ['LayoutTests/fast/css/display-none-inline-style-change-crash.html']),
     93                       ['fast/css/display-none-inline-style-change-crash.html']),
    9494             TestShard('ietestcenter/Javascript',
    95                        ['LayoutTests/ietestcenter/Javascript/11.1.5_4-4-c-1.html'])])
     95                       ['ietestcenter/Javascript/11.1.5_4-4-c-1.html'])])
    9696
    9797    def test_shard_every_file(self):
    9898        locked, unlocked = self.get_shards(num_workers=2, fully_parallel=True)
    9999        self.assertEquals(locked,
    100             [TestShard('.', ['LayoutTests/http/tests/websocket/tests/unicode.htm']),
    101              TestShard('.', ['LayoutTests/http/tests/security/view-source-no-refresh.html']),
    102              TestShard('.', ['LayoutTests/http/tests/websocket/tests/websocket-protocol-ignored.html']),
    103              TestShard('.', ['LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html'])])
     100            [TestShard('.', ['http/tests/websocket/tests/unicode.htm']),
     101             TestShard('.', ['http/tests/security/view-source-no-refresh.html']),
     102             TestShard('.', ['http/tests/websocket/tests/websocket-protocol-ignored.html']),
     103             TestShard('.', ['http/tests/xmlhttprequest/supported-xml-content-types.html'])])
    104104        self.assertEquals(unlocked,
    105             [TestShard('.', ['LayoutTests/animations/keyframes.html']),
    106              TestShard('.', ['LayoutTests/fast/css/display-none-inline-style-change-crash.html']),
    107              TestShard('.', ['LayoutTests/dom/html/level2/html/HTMLAnchorElement03.html']),
    108              TestShard('.', ['LayoutTests/ietestcenter/Javascript/11.1.5_4-4-c-1.html']),
    109              TestShard('.', ['LayoutTests/dom/html/level2/html/HTMLAnchorElement06.html'])])
     105            [TestShard('.', ['animations/keyframes.html']),
     106             TestShard('.', ['fast/css/display-none-inline-style-change-crash.html']),
     107             TestShard('.', ['dom/html/level2/html/HTMLAnchorElement03.html']),
     108             TestShard('.', ['ietestcenter/Javascript/11.1.5_4-4-c-1.html']),
     109             TestShard('.', ['dom/html/level2/html/HTMLAnchorElement06.html'])])
    110110
    111111    def test_shard_in_two(self):
     
    113113        self.assertEquals(locked,
    114114            [TestShard('locked_tests',
    115                        ['LayoutTests/http/tests/websocket/tests/unicode.htm',
    116                         'LayoutTests/http/tests/security/view-source-no-refresh.html',
    117                         'LayoutTests/http/tests/websocket/tests/websocket-protocol-ignored.html',
    118                         'LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html'])])
     115                       ['http/tests/websocket/tests/unicode.htm',
     116                        'http/tests/security/view-source-no-refresh.html',
     117                        'http/tests/websocket/tests/websocket-protocol-ignored.html',
     118                        'http/tests/xmlhttprequest/supported-xml-content-types.html'])])
    119119        self.assertEquals(unlocked,
    120120            [TestShard('unlocked_tests',
    121                        ['LayoutTests/animations/keyframes.html',
    122                         'LayoutTests/fast/css/display-none-inline-style-change-crash.html',
    123                         'LayoutTests/dom/html/level2/html/HTMLAnchorElement03.html',
    124                         'LayoutTests/ietestcenter/Javascript/11.1.5_4-4-c-1.html',
    125                         'LayoutTests/dom/html/level2/html/HTMLAnchorElement06.html'])])
    126 
     121                       ['animations/keyframes.html',
     122                        'fast/css/display-none-inline-style-change-crash.html',
     123                        'dom/html/level2/html/HTMLAnchorElement03.html',
     124                        'ietestcenter/Javascript/11.1.5_4-4-c-1.html',
     125                        'dom/html/level2/html/HTMLAnchorElement06.html'])])
     126
     127
     128class ManagerTest(unittest.TestCase):
    127129    def test_http_locking(tester):
    128130        class LockCheckingManager(Manager):
     
    160162    def test_interrupt_if_at_failure_limits(self):
    161163        port = Mock()
     164        port.TEST_PATH_SEPARATOR = '/'
    162165        port._filesystem = filesystem_mock.MockFileSystem()
    163166        manager = Manager(port=port, options=MockOptions(), printer=Mock())
     
    207210
    208211
    209 class PathCompareTest(unittest.TestCase):
     212class KeyCompareTest(unittest.TestCase):
    210213    def setUp(self):
    211         self.filesystem = filesystem_mock.MockFileSystem()
    212 
    213     def path_key(self, k):
    214         return path_key(self.filesystem, k)
     214        self.port = layout_tests.port.get('test')
    215215
    216216    def assert_cmp(self, x, y, result):
    217         self.assertEquals(cmp(self.path_key(x), self.path_key(y)), result)
    218 
    219     def test_path_compare(self):
     217        self.assertEquals(cmp(test_key(self.port, x), test_key(self.port, y)), result)
     218
     219    def test_test_key(self):
    220220        self.assert_cmp('/a', '/a', 0)
    221221        self.assert_cmp('/a', '/b', -1)
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing.py

    r88986 r90520  
    322322           - timing info
    323323        """
    324         filename = result.filename
    325         test_name = self._port.relative_test_filename(filename)
     324        filename = self._port.abspath_for_test(result.test_name)
     325        test_name = result.test_name
    326326        self._write('trace: %s' % test_name)
    327327        for extension in ('.txt', '.png', '.wav', '.webarchive'):
     
    334334    def _print_baseline(self, filename, extension):
    335335        baseline = self._port.expected_filename(filename, extension)
    336         if self._port.path_exists(baseline):
     336        if self._port._filesystem.exists(baseline):
    337337            relpath = self._port.relative_test_filename(baseline)
    338338        else:
     
    344344        desc = TestExpectations.EXPECTATION_DESCRIPTIONS[result.type][0]
    345345        self.write("  %s -> unexpected %s" %
    346                    (self._port.relative_test_filename(result.filename),
    347                     desc), "unexpected")
     346                   (result.test_name, desc), "unexpected")
    348347
    349348    def print_progress(self, result_summary, retrying, test_list):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py

    r90413 r90520  
    124124        return printer, regular_output, buildbot_output
    125125
    126     def get_result(self, test, result_type=test_expectations.PASS, run_time=0):
     126    def get_result(self, test_name, result_type=test_expectations.PASS, run_time=0):
    127127        failures = []
    128128        if result_type == test_expectations.TIMEOUT:
     
    130130        elif result_type == test_expectations.CRASH:
    131131            failures = [test_failures.FailureCrash()]
    132         path = self._port._filesystem.join(self._port.layout_tests_dir(), test)
    133         return test_results.TestResult(path, failures=failures, test_run_time=run_time)
    134 
    135     def get_result_summary(self, tests, expectations_str):
    136         test_paths = [self._port._filesystem.join(self._port.layout_tests_dir(), test) for
    137                       test in tests]
     132        return test_results.TestResult(test_name, failures=failures, test_run_time=run_time)
     133
     134    def get_result_summary(self, test_names, expectations_str):
    138135        expectations = test_expectations.TestExpectations(
    139             self._port, test_paths, expectations_str,
     136            self._port, test_names, expectations_str,
    140137            self._port.test_configuration(),
    141138            is_lint_mode=False)
    142139
    143         rs = result_summary.ResultSummary(expectations, test_paths)
    144         return test_paths, rs, expectations
     140        rs = result_summary.ResultSummary(expectations, test_names)
     141        return test_names, rs, expectations
    145142
    146143    def test_help_printer(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/result_summary.py

    r90413 r90520  
    7474        """
    7575
    76         self.tests_by_expectation[result.type].add(result.filename)
    77         self.results[result.filename] = result
     76        self.tests_by_expectation[result.type].add(result.test_name)
     77        self.results[result.test_name] = result
    7878        self.remaining -= 1
    7979        if len(result.failures):
    80             self.failures[result.filename] = result.failures
     80            self.failures[result.test_name] = result.failures
    8181        if expected:
    8282            self.expected += 1
    8383        else:
    84             self.unexpected_results[result.filename] = result
     84            self.unexpected_results[result.test_name] = result
    8585            self.unexpected += 1
    8686            if len(result.failures):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/single_test_runner.py

    r90506 r90520  
    5252        self._port = port
    5353        self._driver = driver
    54         self._filename = test_input.filename
    5554        self._timeout = test_input.timeout
    5655        self._worker_name = worker_name
    57         self._testname = port.relative_test_filename(test_input.filename)
     56        self._test_name = test_input.test_name
    5857
    5958        self._is_reftest = False
     
    6261
    6362        fs = port._filesystem
    64         reftest_expected_filename = port.reftest_expected_filename(self._filename)
     63        reftest_expected_filename = port.reftest_expected_filename(self._test_name)
    6564        if fs.exists(reftest_expected_filename):
    6665            self._is_reftest = True
    6766            self._reference_filename = reftest_expected_filename
    6867
    69         reftest_expected_mismatch_filename = port.reftest_expected_mismatch_filename(self._filename)
     68        reftest_expected_mismatch_filename = port.reftest_expected_mismatch_filename(self._test_name)
    7069        if fs.exists(reftest_expected_mismatch_filename):
    7170            if self._is_reftest:
     
    8584            # in either layout tests or reftests, but not in both.
    8685            for suffix in ('.txt', '.png', '.wav'):
    87                 expected_filename = self._port.expected_filename(self._filename, suffix)
     86                expected_filename = self._port.expected_filename(self._test_name, suffix)
    8887                if fs.exists(expected_filename):
    8988                    _log.error('The reftest (%s) can not have an expectation file (%s).'
    90                                ' Please remove that file.', self._testname, expected_filename)
     89                               ' Please remove that file.', self._test_name, expected_filename)
    9190
    9291    def _expected_driver_output(self):
    93         return DriverOutput(self._port.expected_text(self._filename),
    94                                  self._port.expected_image(self._filename),
    95                                  self._port.expected_checksum(self._filename),
    96                                  self._port.expected_audio(self._filename))
     92        return DriverOutput(self._port.expected_text(self._test_name),
     93                                 self._port.expected_image(self._test_name),
     94                                 self._port.expected_checksum(self._test_name),
     95                                 self._port.expected_audio(self._test_name))
    9796
    9897    def _should_fetch_expected_checksum(self):
     
    107106        image_hash = None
    108107        if self._should_fetch_expected_checksum():
    109             image_hash = self._port.expected_checksum(self._filename)
    110         return DriverInput(self._filename, self._timeout, image_hash)
     108            image_hash = self._port.expected_checksum(self._test_name)
     109        return DriverInput(self._test_name, self._timeout, image_hash)
    111110
    112111    def run(self):
     
    114113            if self._is_reftest:
    115114                # Returns a dummy TestResult. We don't have to rebase for reftests.
    116                 return TestResult(self._filename)
     115                return TestResult(self._test_name)
    117116            else:
    118117                return self._run_rebaseline()
     
    120119            if self._port.get_option('pixel_tests'):
    121120                return self._run_reftest()
    122             result = TestResult(self._filename)
     121            result = TestResult(self._test_name)
    123122            result.type = test_expectations.SKIP
    124123            return result
     
    131130        if self._options.new_test_results:
    132131            self._add_missing_baselines(test_result, driver_output)
    133         test_result_writer.write_test_result(self._port, self._filename, driver_output, expected_driver_output, test_result.failures)
     132        test_result_writer.write_test_result(self._port, self._test_name, driver_output, expected_driver_output, test_result.failures)
    134133        return test_result
    135134
     
    137136        driver_output = self._driver.run_test(self._driver_input())
    138137        failures = self._handle_error(driver_output)
    139         test_result_writer.write_test_result(self._port, self._filename, driver_output, None, failures)
     138        test_result_writer.write_test_result(self._port, self._test_name, driver_output, None, failures)
    140139        # FIXME: It the test crashed or timed out, it might be bettter to avoid
    141140        # to write new baselines.
    142141        self._overwrite_baselines(driver_output)
    143         return TestResult(self._filename, failures, driver_output.test_time, driver_output.has_stderr())
     142        return TestResult(self._test_name, failures, driver_output.test_time, driver_output.has_stderr())
    144143
    145144    def _add_missing_baselines(self, test_result, driver_output):
     
    181180        fs = port._filesystem
    182181        if generate_new_baseline:
    183             relative_dir = fs.dirname(self._testname)
     182            relative_dir = fs.dirname(self._test_name)
    184183            baseline_path = port.baseline_path()
    185184            output_dir = fs.join(baseline_path, relative_dir)
    186             output_file = fs.basename(fs.splitext(self._filename)[0] +
     185            output_file = fs.basename(fs.splitext(self._test_name)[0] +
    187186                "-expected" + modifier)
    188187            fs.maybe_make_directory(output_dir)
    189188            output_path = fs.join(output_dir, output_file)
    190189        else:
    191             output_path = port.expected_filename(self._filename, modifier)
     190            output_path = port.expected_filename(self._test_name, modifier)
    192191
    193192        result_name = fs.relpath(output_path, port.layout_tests_dir())
    194193        _log.info('Writing new expected result "%s"' % result_name)
    195 
    196194        port.update_baseline(output_path, data)
    197195
     
    213211            testname = self._port.relative_test_filename(reference_filename)
    214212        else:
    215             testname = self._testname
     213            testname = self._test_name
    216214
    217215        if driver_output.crash:
     
    231229            # Don't continue any more if we already have a crash.
    232230            # In case of timeouts, we continue since we still want to see the text and image output.
    233             return TestResult(self._filename, failures, driver_output.test_time, driver_output.has_stderr())
     231            return TestResult(self._test_name, failures, driver_output.test_time, driver_output.has_stderr())
    234232
    235233        failures.extend(self._compare_text(driver_output.text, expected_driver_output.text))
     
    237235        if self._options.pixel_tests:
    238236            failures.extend(self._compare_image(driver_output, expected_driver_output))
    239         return TestResult(self._filename, failures, driver_output.test_time, driver_output.has_stderr())
     237        return TestResult(self._test_name, failures, driver_output.test_time, driver_output.has_stderr())
    240238
    241239    def _compare_text(self, actual_text, expected_text):
     
    286284    def _run_reftest(self):
    287285        driver_output1 = self._driver.run_test(self._driver_input())
    288         driver_output2 = self._driver.run_test(DriverInput(self._reference_filename, self._timeout, driver_output1.image_hash))
     286        reference_test_name = self._port.relative_test_filename(self._reference_filename)
     287        driver_output2 = self._driver.run_test(DriverInput(reference_test_name, self._timeout, driver_output1.image_hash))
    289288        test_result = self._compare_output_with_reference(driver_output1, driver_output2)
    290289
    291         test_result_writer.write_test_result(self._port, self._filename, driver_output1, driver_output2, test_result.failures)
     290        test_result_writer.write_test_result(self._port, self._test_name, driver_output1, driver_output2, test_result.failures)
    292291        return test_result
    293292
     
    299298        if failures:
    300299            # Don't continue any more if we already have crash or timeout.
    301             return TestResult(self._filename, failures, total_test_time, has_stderr)
     300            return TestResult(self._test_name, failures, total_test_time, has_stderr)
    302301        failures.extend(self._handle_error(driver_output2, reference_filename=self._reference_filename))
    303302        if failures:
    304             return TestResult(self._filename, failures, total_test_time, has_stderr)
     303            return TestResult(self._test_name, failures, total_test_time, has_stderr)
    305304
    306305        if self._is_mismatch_reftest:
     
    309308        elif driver_output1.image_hash != driver_output2.image_hash:
    310309            failures.append(test_failures.FailureReftestMismatch())
    311         return TestResult(self._filename, failures, total_test_time, has_stderr)
     310        return TestResult(self._test_name, failures, total_test_time, has_stderr)
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py

    r90479 r90520  
    447447
    448448    def _add_to_all_expectations(self, test, options, expectations):
    449         # Make all paths unix-style so the dashboard doesn't need to.
    450         test = test.replace('\\', '/')
    451449        if not test in self._all_expectations:
    452450            self._all_expectations[test] = []
     
    551549
    552550    def _check_path_does_not_exist(self, lineno, test_list_path):
    553         full_path = self._fs.join(self._port.layout_tests_dir(),
    554                                   test_list_path)
    555         full_path = self._fs.normpath(full_path)
    556551        # WebKit's way of skipping tests is to add a -disabled suffix.
    557552            # So we should consider the path existing if the path or the
    558553        # -disabled version exists.
    559         if (not self._port.path_exists(full_path)
    560             and not self._port.path_exists(full_path + '-disabled')):
     554        if (not self._port.test_exists(test_list_path)
     555            and not self._port.test_exists(test_list_path + '-disabled')):
    561556            # Log a non fatal error here since you hit this case any
    562557            # time you update test_expectations.txt without syncing
     
    576571        # files and nodes being categories.
    577572
    578         path = self._fs.join(self._port.layout_tests_dir(), test_list_path)
    579         path = self._fs.normpath(path)
    580         if self._fs.isdir(path):
     573        if self._port.test_isdir(test_list_path):
    581574            # this is a test category, return all the tests of the category.
    582             path = self._fs.join(path, '')
    583 
    584             return [test for test in self._full_test_list if test.startswith(path)]
     575            test_list_path = self._port.normalize_test_name(test_list_path)
     576
     577            return [test for test in self._full_test_list if test.startswith(test_list_path)]
    585578
    586579        # this is a test file, do a quick check if it's in the
    587580        # full test suite.
    588581        result = []
    589         if path in self._full_test_list:
    590             result = [path, ]
     582        if test_list_path in self._full_test_list:
     583            result = [test_list_path, ]
    591584        return result
    592585
     
    598591
    599592            self._clear_expectations_for_test(test, test_list_path)
    600             self._test_list_paths[test] = (self._fs.normpath(test_list_path), num_matches, lineno)
     593            self._test_list_paths[test] = (self._port.normalize_test_name(test_list_path), num_matches, lineno)
    601594            self._add_test(test, modifiers, expectations, options, overrides_allowed)
    602595
     
    655648            self._remove_from_sets(test, self._result_type_to_tests)
    656649
    657         self._test_list_paths[test] = self._fs.normpath(test_list_path)
     650        self._test_list_paths[test] = self._port.normalize_test_name(test_list_path)
    658651
    659652    def _remove_from_sets(self, test, dict):
     
    675668        """
    676669        # FIXME: See comment below about matching test configs and num_matches.
    677 
    678670        if not test in self._test_list_paths:
    679671            # We've never seen this test before.
     
    681673
    682674        prev_base_path, prev_num_matches, prev_lineno = self._test_list_paths[test]
    683         base_path = self._fs.normpath(test_list_path)
     675        base_path = self._port.normalize_test_name(test_list_path)
    684676
    685677        if len(prev_base_path) > len(base_path):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py

    r85880 r90520  
    9090
    9191    def get_test(self, test_name):
    92         return self._fs.join(self._port.layout_tests_dir(), test_name)
     92        # FIXME: Remove this routine and just reference test names directly.
     93        return test_name
    9394
    9495    def get_basic_tests(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_input.py

    r89542 r90520  
    3333    """Groups information about a test for easy passing of data."""
    3434
    35     def __init__(self, filename, timeout):
     35    def __init__(self, test_name, timeout):
    3636        """Holds the input parameters for a test.
    3737        Args:
    38           filename: Full path to the test.
     38          test: name of test (not an absolute path!)
    3939          timeout: Timeout in msecs the driver should use while running the test
    4040          """
    41         # FIXME: filename should really be test_name as a relative path.
    42         self.filename = filename
     41        self.test_name = test_name
    4342        self.timeout = timeout
    4443
    4544    def __repr__(self):
    46         return "TestInput('%s', %d)" % (self.filename, self.timeout)
     45        return "TestInput('%s', %d)" % (self.test_name, self.timeout)
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_result_writer.py

    r90138 r90520  
    3838
    3939
    40 def write_test_result(port, filename, driver_output,
     40def write_test_result(port, test_name, driver_output,
    4141                      expected_driver_output, failures):
    4242    """Write the test result to the result output directory."""
    4343    root_output_dir = port.results_directory()
    44     writer = TestResultWriter(port, root_output_dir, filename)
     44    writer = TestResultWriter(port, root_output_dir, test_name)
    4545    if driver_output.error:
    4646        writer.write_stderr(driver_output.error)
     
    7474            if image_diff:
    7575                writer.write_image_diff_files(image_diff)
    76             writer.copy_file(port.reftest_expected_filename(filename), '-expected.html')
     76            writer.copy_file(port.reftest_expected_filename(test_name), '-expected.html')
    7777        elif isinstance(failure, test_failures.FailureReftestMismatchDidNotOccur):
    7878            writer.write_image_files(driver_output.image, expected_image=None)
    79             writer.copy_file(port.reftest_expected_mismatch_filename(filename), '-expected-mismatch.html')
     79            writer.copy_file(port.reftest_expected_mismatch_filename(test_name), '-expected-mismatch.html')
    8080        else:
    8181            assert isinstance(failure, (test_failures.FailureTimeout,))
     
    9696    FILENAME_SUFFIX_IMAGE_DIFFS_HTML = "-diffs.html"
    9797
    98     def __init__(self, port, root_output_dir, filename):
     98    def __init__(self, port, root_output_dir, test_name):
    9999        self._port = port
    100100        self._root_output_dir = root_output_dir
    101         self._filename = filename
    102         self._testname = port.relative_test_filename(filename)
     101        self._test_name = test_name
    103102
    104103    def _make_output_directory(self):
    105104        """Creates the output directory (if needed) for a given test filename."""
    106105        fs = self._port._filesystem
    107         output_filename = fs.join(self._root_output_dir, self._testname)
     106        output_filename = fs.join(self._root_output_dir, self._test_name)
    108107        self._port.maybe_make_directory(fs.dirname(output_filename))
    109108
     
    121120        """
    122121        fs = self._port._filesystem
    123         output_filename = fs.join(self._root_output_dir, self._testname)
     122        output_filename = fs.join(self._root_output_dir, self._test_name)
    124123        return fs.splitext(output_filename)[0] + modifier
    125124
    126125    def _output_testname(self, modifier):
    127126        fs = self._port._filesystem
    128         return fs.splitext(fs.basename(self._testname))[0] + modifier
     127        return fs.splitext(fs.basename(self._test_name))[0] + modifier
    129128
    130129    def write_output_files(self, file_type, output, expected):
     
    259258</html>
    260259""" % {
    261             'title': self._testname,
     260            'title': self._test_name,
    262261            'diff_filename': self._output_testname(self.FILENAME_SUFFIX_IMAGE_DIFF),
    263262            'prefix': self._output_testname(''),
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results.py

    r90055 r90520  
    3939        return cPickle.loads(str)
    4040
    41     def __init__(self, filename, failures=None, test_run_time=None, has_stderr=False):
    42         # FIXME: s/filename/name to be consistent with the rest of layout_package.
    43         self.filename = filename
     41    def __init__(self, test_name, failures=None, test_run_time=None, has_stderr=False):
     42        self.test_name = test_name
    4443        self.failures = failures or []
    4544        self.test_run_time = test_run_time or 0
     
    4948
    5049    def __eq__(self, other):
    51         return (self.filename == other.filename and
     50        return (self.test_name == other.test_name and
    5251                self.failures == other.failures and
    5352                self.test_run_time == other.test_run_time)
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py

    r89852 r90520  
    3535    def test_defaults(self):
    3636        result = TestResult("foo")
    37         self.assertEqual(result.filename, 'foo')
     37        self.assertEqual(result.test_name, 'foo')
    3838        self.assertEqual(result.failures, [])
    3939        self.assertEqual(result.test_run_time, 0)
    4040
    4141    def test_loads(self):
    42         result = TestResult(filename='foo',
     42        result = TestResult(test_name='foo',
    4343                            failures=[],
    4444                            test_run_time=1.1)
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/worker.py

    r90279 r90520  
    183183    def clean_up_after_test(self, test_input, result):
    184184        self._batch_count += 1
    185         test_name = self._port.relative_test_filename(test_input.filename)
     185        test_name = test_input.test_name
    186186        self._tests_run_file.write(test_name + "\n")
    187187
     
    247247
    248248        if not result:
    249             result = test_results.TestResult(test_input.filename, failures=[], test_run_time=0)
     249            result = test_results.TestResult(test_input.test_name, failures=[], test_run_time=0)
    250250        return result
    251251
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py

    r90514 r90520  
    8484    port_name = None  # Subclasses override this
    8585
     86    # Test names resemble unix relative paths, and use '/' as a directory separator.
     87    TEST_PATH_SEPARATOR = '/'
     88
    8689    def __init__(self, port_name=None, options=None,
    8790                 executive=None,
     
    200203                return False
    201204
    202         if not self.path_exists(self._pretty_patch_path):
     205        if not self._filesystem.exists(self._pretty_patch_path):
    203206            if logging:
    204207                _log.error("Unable to find %s; can't generate pretty patches." % self._pretty_patch_path)
     
    289292        return "DumpRenderTree"
    290293
    291     def expected_baselines(self, filename, suffix, all_baselines=False):
     294    def expected_baselines(self, test_name, suffix, all_baselines=False):
    292295        """Given a test name, finds where the baseline results are located.
    293296
    294297        Args:
    295         filename: absolute filename to test file
     298        test_name: name of test file (usually a relative path under LayoutTests/)
    296299        suffix: file suffix of the expected results, including dot; e.g.
    297300            '.txt' or '.png'.  This should not be None, but may be an empty
     
    316319        platform specific.
    317320        """
    318         testname = self._filesystem.splitext(self.relative_test_filename(filename))[0]
    319 
    320         baseline_filename = testname + '-expected' + suffix
    321 
     321        baseline_filename = self._filesystem.splitext(test_name)[0] + '-expected' + suffix
    322322        baseline_search_path = self.get_option('additional_platform_directory', []) + self.baseline_search_path()
    323323
    324324        baselines = []
    325325        for platform_dir in baseline_search_path:
    326             if self.path_exists(self._filesystem.join(platform_dir, baseline_filename)):
     326            if self._filesystem.exists(self._filesystem.join(platform_dir, baseline_filename)):
    327327                baselines.append((platform_dir, baseline_filename))
    328328
     
    333333        # result in the test directory, even if no such file actually exists.
    334334        platform_dir = self.layout_tests_dir()
    335         if self.path_exists(self._filesystem.join(platform_dir, baseline_filename)):
     335        if self._filesystem.exists(self._filesystem.join(platform_dir, baseline_filename)):
    336336            baselines.append((platform_dir, baseline_filename))
    337337
     
    341341        return [(None, baseline_filename)]
    342342
    343     def expected_filename(self, filename, suffix):
     343    def expected_filename(self, test_name, suffix):
    344344        """Given a test name, returns an absolute path to its expected results.
    345345
     
    350350
    351351        Args:
    352         filename: absolute filename to test file
     352        test_name: name of test file (usually a relative path under LayoutTests/)
    353353        suffix: file suffix of the expected results, including dot; e.g. '.txt'
    354354            or '.png'.  This should not be None, but may be an empty string.
     
    361361        """
    362362        # FIXME: The [0] here is very mysterious, as is the destructured return.
    363         platform_dir, baseline_filename = self.expected_baselines(filename, suffix)[0]
     363        platform_dir, baseline_filename = self.expected_baselines(test_name, suffix)[0]
    364364        if platform_dir:
    365365            return self._filesystem.join(platform_dir, baseline_filename)
    366366        return self._filesystem.join(self.layout_tests_dir(), baseline_filename)
    367367
    368     def expected_checksum(self, test):
     368    def expected_checksum(self, test_name):
    369369        """Returns the checksum of the image we expect the test to produce, or None if it is a text-only test."""
    370         png_path = self.expected_filename(test, '.png')
    371 
    372         if self.path_exists(png_path):
     370        png_path = self.expected_filename(test_name, '.png')
     371
     372        if self._filesystem.exists(png_path):
    373373            with self._filesystem.open_binary_file_for_reading(png_path) as filehandle:
    374374                return read_checksum_from_png.read_checksum(filehandle)
     
    376376        return None
    377377
    378     def expected_image(self, test):
     378    def expected_image(self, test_name):
    379379        """Returns the image we expect the test to produce."""
    380         path = self.expected_filename(test, '.png')
    381         if not self.path_exists(path):
     380        path = self.expected_filename(test_name, '.png')
     381        if not self._filesystem.exists(path):
    382382            return None
    383383        return self._filesystem.read_binary_file(path)
    384384
    385     def expected_audio(self, test):
    386         path = self.expected_filename(test, '.wav')
    387         if not self.path_exists(path):
     385    def expected_audio(self, test_name):
     386        path = self.expected_filename(test_name, '.wav')
     387        if not self._filesystem.exists(path):
    388388            return None
    389389        return self._filesystem.read_binary_file(path)
    390390
    391     def expected_text(self, test):
     391    def expected_text(self, test_name):
    392392        """Returns the text output we expect the test to produce, or None
    393393        if we don't expect there to be any text output.
     
    396396        # output from DRT (instead treating it as a binary string), we read the
    397397        # baselines as a binary string, too.
    398         path = self.expected_filename(test, '.txt')
    399         if not self.path_exists(path):
    400             path = self.expected_filename(test, '.webarchive')
    401             if not self.path_exists(path):
     398        path = self.expected_filename(test_name, '.txt')
     399        if not self._filesystem.exists(path):
     400            path = self.expected_filename(test_name, '.webarchive')
     401            if not self._filesystem.exists(path):
    402402                return None
    403403        text = self._filesystem.read_binary_file(path)
    404404        return text.replace("\r\n", "\n")
    405405
    406     def reftest_expected_filename(self, filename):
     406    def reftest_expected_filename(self, test_name):
    407407        """Return the filename of reference we expect the test matches."""
    408         return self.expected_filename(filename, '.html')
    409 
    410     def reftest_expected_mismatch_filename(self, filename):
     408        return self.expected_filename(test_name, '.html')
     409
     410    def reftest_expected_mismatch_filename(self, test_name):
    411411        """Return the filename of reference we don't expect the test matches."""
    412         return self.expected_filename(filename, '-mismatch.html')
    413 
    414     def filename_to_uri(self, filename):
    415         """Convert a test file (which is an absolute path) to a URI."""
     412        return self.expected_filename(test_name, '-mismatch.html')
     413
     414    def test_to_uri(self, test_name):
     415        """Convert a test name to a URI."""
    416416        LAYOUTTEST_HTTP_DIR = "http/tests/"
    417417        LAYOUTTEST_WEBSOCKET_DIR = "http/tests/websocket/tests/"
    418418
    419         relative_path = self.relative_test_filename(filename)
    420419        port = None
    421420        use_ssl = False
    422421
     422        relative_path = test_name
    423423        if (relative_path.startswith(LAYOUTTEST_WEBSOCKET_DIR)
    424424            or relative_path.startswith(LAYOUTTEST_HTTP_DIR)):
     
    438438            return "%s://127.0.0.1:%u/%s" % (protocol, port, relative_path)
    439439
    440         return path.abspath_to_uri(self._filesystem.abspath(filename))
     440        return path.abspath_to_uri(self.abspath_for_test(test_name))
    441441
    442442    def tests(self, paths):
    443         """Return the list of tests found (relative to layout_tests_dir()."""
    444         return test_files.find(self, paths)
     443        """Return the list of tests found."""
     444        # FIXME: Should test_files.find() return normalized, relative test names?
     445        return set([self.relative_test_filename(f) for f in test_files.find(self, paths)])
    445446
    446447    def test_dirs(self):
     
    450451                      self._filesystem.listdir(layout_tests_dir))
    451452
    452     def path_isdir(self, path):
    453         """Return True if the path refers to a directory of tests."""
     453    def test_isdir(self, test_name):
     454        """Return True if the test name refers to a directory of tests."""
    454455        # Used by test_expectations.py to apply rules to whole directories.
     456        path = self.abspath_for_test(test_name)
    455457        return self._filesystem.isdir(path)
    456458
    457     def path_exists(self, path):
    458         """Return True if the path refers to an existing test or baseline."""
     459    def test_exists(self, test_name):
     460        """Return True if the test name refers to an existing test or baseline."""
    459461        # Used by test_expectations.py to determine if an entry refers to a
    460462        # valid test and by printing.py to determine if baselines exist.
     463        path = self.abspath_for_test(test_name)
    461464        return self._filesystem.exists(path)
     465
     466    def split_test(self, test_name):
     467        """Splits a test name into the 'directory' part and the 'basename' part."""
     468        index = test_name.rfind(self.TEST_PATH_SEPARATOR)
     469        if index < 1:
     470            return ('', test_name)
     471        return (test_name[0:index], test_name[index:])
     472
     473    def normalize_test_name(self, test_name):
     474        """Returns a normalized version of the test name or test directory."""
     475        if self.test_isdir(test_name) and not test_name.endswith('/'):
     476            return test_name + '/'
     477        return test_name
    462478
    463479    def driver_cmd_line(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py

    r90506 r90520  
    191191        self.assertTrue('css2.1' in dirs)
    192192
    193     def test_filename_to_uri(self):
     193    def test_test_to_uri(self):
    194194        port = Port()
    195195        layout_test_dir = port.layout_tests_dir()
    196         test_file = port._filesystem.join(layout_test_dir, "foo", "bar.html")
    197 
    198         # On Windows, absolute paths are of the form "c:\foo.txt". However,
    199         # all current browsers (except for Opera) normalize file URLs by
    200         # prepending an additional "/" as if the absolute path was
    201         # "/c:/foo.txt". This means that all file URLs end up with "file:///"
    202         # at the beginning.
     196        test = 'foo/bar.html'
     197        path = port._filesystem.join(layout_test_dir, test)
    203198        if sys.platform == 'win32':
    204             prefix = "file:///"
    205             path = test_file.replace("\\", "/")
    206         else:
    207             prefix = "file://"
    208             path = test_file
    209 
    210         self.assertEqual(port.filename_to_uri(test_file), abspath_to_uri(test_file))
     199            path = path.replace("\\", "/")
     200
     201        self.assertEqual(port.test_to_uri(test), abspath_to_uri(path))
    211202
    212203    def test_get_option__set(self):
     
    237228        port.baseline_search_path = lambda: ['LayoutTests/platform/foo']
    238229        layout_test_dir = port.layout_tests_dir()
    239         test_file = filesystem.join(layout_test_dir, 'fast', 'test.html')
     230        test_file = 'fast/test.html'
    240231
    241232        # No additional platform directory
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py

    r90514 r90520  
    289289            self, all_test_files, expectations_str, self.test_configuration(),
    290290            is_lint_mode=False, overrides=overrides_str)
    291         tests_dir = self.layout_tests_dir()
    292         return [self.relative_test_filename(test)
    293                 for test in expectations.get_tests_with_result_type(test_expectations.SKIP)]
     291        return expectations.get_tests_with_result_type(test_expectations.SKIP)
    294292
    295293    def test_repository_paths(self):
     
    484482        has_base64 = False
    485483
    486         uri = self._port.filename_to_uri(driver_input.filename)
     484        uri = self._port.test_to_uri(driver_input.test_name)
    487485        cmd = self._test_shell_command(uri, driver_input.timeout,
    488486                                       driver_input.image_hash)
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py

    r90138 r90520  
    185185        port = ChromiumPortTest.TestLinuxPort(options=mock_options)
    186186
    187         fake_test = port._filesystem.join(port.layout_tests_dir(), "fast/js/not-good.js")
     187        fake_test = 'fast/js/not-good.js'
    188188
    189189        port.test_expectations = lambda: """BUG_TEST SKIP : fast/js/not-good.js = TEXT
     
    191191        port.test_expectations_overrides = lambda: ''
    192192        port.tests = lambda paths: set()
    193         port.path_exists = lambda test: True
     193        port.test_exists = lambda test: True
    194194
    195195        skipped_tests = port.skipped_layout_tests(extra_test_files=[fake_test, ])
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/driver.py

    r90506 r90520  
    3131
    3232class DriverInput(object):
    33     def __init__(self, filename, timeout, image_hash):
    34         # FIXME: The args should just be renamed to reflect their use.
    35         self.filename = filename  # Full path to the test.
     33    def __init__(self, test_name, timeout, image_hash):
     34        self.test_name = test_name
    3635        self.timeout = timeout  # in ms
    3736        self.image_hash = image_hash
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/dryrun.py

    r90506 r90520  
    116116        start_time = time.time()
    117117        fs = self._port._filesystem
    118         if (fs.exists(self._port.reftest_expected_filename(driver_input.filename)) or
    119             fs.exists(self._port.reftest_expected_mismatch_filename(driver_input.filename)) or
    120             driver_input.filename.endswith('-expected.html')):
     118        if (fs.exists(self._port.reftest_expected_filename(driver_input.test_name)) or
     119            fs.exists(self._port.reftest_expected_mismatch_filename(driver_input.test_name)) or
     120            driver_input.test_name.endswith('-expected.html')):
    121121            text = 'test-text'
    122122            image = 'test-image'
    123123            checksum = 'test-checksum'
    124124            audio = None
    125         elif driver_input.filename.endswith('-expected-mismatch.html'):
     125        elif driver_input.test_name.endswith('-expected-mismatch.html'):
    126126            text = 'test-text-mismatch'
    127127            image = 'test-image-mismatch'
     
    129129            audio = None
    130130        else:
    131             text = self._port.expected_text(driver_input.filename)
    132             image = self._port.expected_image(driver_input.filename)
    133             checksum = self._port.expected_checksum(driver_input.filename)
    134             audio = self._port.expected_audio(driver_input.filename)
     131            text = self._port.expected_text(driver_input.test_name)
     132            image = self._port.expected_image(driver_input.test_name)
     133            checksum = self._port.expected_checksum(driver_input.test_name)
     134            audio = self._port.expected_audio(driver_input.test_name)
    135135        return DriverOutput(text, image, checksum, audio, crash=False, test_time=time.time() - start_time, timeout=False, error='')
    136136
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py

    r90506 r90520  
    202202        if test_input.uri.startswith('http'):
    203203            test_name = port.uri_to_test_name(test_input.uri)
    204             test_path = self._filesystem.join(port.layout_tests_dir(), test_name)
    205         else:
    206             test_path = test_input.uri
    207 
    208         actual_text = port.expected_text(test_path)
    209         actual_audio = port.expected_audio(test_path)
    210         if self._options.pixel_tests and test_input.checksum:
    211             actual_checksum = port.expected_checksum(test_path)
    212             actual_image = port.expected_image(test_path)
     204        else:
     205            test_name = port.relative_test_filename(test_input.uri)
     206
     207        actual_text = port.expected_text(test_name)
     208        actual_audio = port.expected_audio(test_name)
     209        if self._options.pixel_tests and test_input.checksum:
     210            actual_checksum = port.expected_checksum(test_name)
     211            actual_image = port.expected_image(test_name)
    213212
    214213        if actual_audio:
     
    258257        port = self._port
    259258        test_name = self._port.uri_to_test_name(test_input.uri)
    260         test_path = self._filesystem.join(port.layout_tests_dir(), test_name)
    261 
    262         actual_text = port.expected_text(test_path)
     259
     260        actual_text = port.expected_text(test_name)
    263261        actual_image = ''
    264262        actual_checksum = ''
    265263        if self._options.pixel_tests and test_input.checksum:
    266             actual_checksum = port.expected_checksum(test_path)
     264            actual_checksum = port.expected_checksum(test_name)
    267265            if actual_checksum != test_input.checksum:
    268                 actual_image = port.expected_image(test_path)
     266                actual_image = port.expected_image(test_name)
    269267
    270268        self._stdout.write("#URL:%s\n" % test_input.uri)
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py

    r90514 r90520  
    8585
    8686class MockDRTTest(unittest.TestCase):
    87     def to_path(self, port, test_name):
    88         return port._filesystem.join(port.layout_tests_dir(), test_name)
    89 
    9087    def input_line(self, port, test_name, checksum=None):
    91         url = port.filename_to_uri(self.to_path(port, test_name))
     88        url = port.test_to_uri(test_name)
    9289        # FIXME: we shouldn't have to work around platform-specific issues
    9390        # here.
     
    111108    def make_input_output(self, port, test_name, pixel_tests,
    112109                          expected_checksum, drt_output, drt_input=None):
    113         path = self.to_path(port, test_name)
    114110        if pixel_tests:
    115111            if not expected_checksum:
    116                 expected_checksum = port.expected_checksum(path)
     112                expected_checksum = port.expected_checksum(test_name)
    117113        if not drt_input:
    118114            drt_input = self.input_line(port, test_name, expected_checksum)
    119         text_output = port.expected_text(path)
     115        text_output = port.expected_text(test_name)
    120116
    121117        if not drt_output:
     
    217213
    218214    def input_line(self, port, test_name, checksum=None):
    219         url = port.filename_to_uri(self.to_path(port, test_name))
     215        url = port.test_to_uri(test_name)
    220216        if checksum:
    221217            return url + ' 6000 ' + checksum + '\n'
     
    223219
    224220    def expected_output(self, port, test_name, pixel_tests, text_output, expected_checksum):
    225         url = port.filename_to_uri(self.to_path(port, test_name))
     221        url = port.test_to_uri(test_name)
    226222        if pixel_tests and expected_checksum:
    227223            return ['#URL:%s\n' % url,
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py

    r90506 r90520  
    366366    # the calls to path.abspath_to_uri() removed. We shouldn't have
    367367    # to do this.
    368     def filename_to_uri(self, filename):
     368    def test_to_uri(self, test_name):
    369369        """Convert a test file (which is an absolute path) to a URI."""
    370370        LAYOUTTEST_HTTP_DIR = "http/tests/"
    371371        LAYOUTTEST_WEBSOCKET_DIR = "http/tests/websocket/tests/"
    372372
    373         relative_path = self.relative_test_filename(filename)
    374373        port = None
    375374        use_ssl = False
    376375
     376        relative_path = test_name
    377377        if (relative_path.startswith(LAYOUTTEST_WEBSOCKET_DIR)
    378378            or relative_path.startswith(LAYOUTTEST_HTTP_DIR)):
     
    393393            return "%s://127.0.0.1:%u/%s" % (protocol, port, relative_path)
    394394
    395         return "file://" + self._filesystem.abspath(filename)
     395        return "file://" + self.abspath_for_test(test_name)
     396
     397    def abspath_for_test(self, test_name):
     398        return self.layout_tests_dir() + self.TEST_PATH_SEPARATOR + test_name
    396399
    397400    def uri_to_test_name(self, uri):
     
    433436    def run_test(self, test_input):
    434437        start_time = time.time()
    435         test_name = self._port.relative_test_filename(test_input.filename)
     438        test_name = test_input.test_name
    436439        test = self._port._tests[test_name]
    437440        if test.keyboard:
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py

    r90506 r90520  
    421421
    422422    def _command_from_driver_input(self, driver_input):
    423         uri = self._port.filename_to_uri(driver_input.filename)
     423        uri = self._port.test_to_uri(driver_input.test_name)
    424424        command = uri[7:] if uri.startswith("file:///") else uri
    425425
  • trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py

    r90506 r90520  
    167167                self._current_test_batch = []
    168168                test_batches.append(self._current_test_batch)
    169             test_name = self._port.relative_test_filename(test_input.filename)
     169            test_name = test_input.test_name
    170170            # In case of reftest, one test calls the driver's run_test() twice.
    171171            # We should not add a reference html used by reftests to tests unless include_reference_html parameter
    172172            # is explicitly given.
    173             if include_reference_html or not is_reference_html_file(test_input.filename):
     173            if include_reference_html or not is_reference_html_file(test_input.test_name):
    174174                self._current_test_batch.append(test_name)
    175175            return TestDriver.run_test(self, test_input)
  • trunk/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py

    r86165 r90520  
    7373        self._error_collector = ErrorCollector()
    7474        port_obj = port.get('test')
    75         self._test_file = port_obj._filesystem.join(port_obj.layout_tests_dir(), 'passes/text.html')
     75        self._test_file = 'passes/text.html'
    7676
    7777    def process_expectations(self, expectations, overrides=None):
  • trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests.py

    r90138 r90520  
    456456
    457457    def _first_fallback_png_for_test(self, test):
    458         test_filepath = self._filesystem.join(self._target_port.layout_tests_dir(), test)
    459         all_baselines = self._rebaseline_port.expected_baselines(
    460             test_filepath, '.png', True)
     458        all_baselines = self._rebaseline_port.expected_baselines(test, '.png', True)
    461459        return self._filesystem.join(all_baselines[0][0], all_baselines[0][1])
    462460
     
    479477          False otherwise.
    480478        """
    481         test_filepath = self._filesystem.join(self._target_port.layout_tests_dir(), test)
    482         all_baselines = self._rebaseline_port.expected_baselines(
    483             test_filepath, suffix, True)
    484         test_relpath = self._filesystem.relpath(test_filepath, self._target_port.layout_tests_dir())
     479        all_baselines = self._rebaseline_port.expected_baselines(test, suffix, True)
    485480
    486481        for fallback_dir, fallback_file in all_baselines:
     
    500495            is_image = baseline_path.lower().endswith('.png')
    501496            if not self._diff_baselines(new_output, fallback_output, is_image):
    502                 _log.info('  Skipping %s (matches %s)', test_relpath, fallback_dir_relpath)
     497                _log.info('  Skipping %s (matches %s)', test, fallback_dir_relpath)
    503498                return True
    504499            return False
  • trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py

    r90506 r90520  
    312312        rebaseliner, filesystem = self.make_rebaseliner("")
    313313        port = rebaseliner._port
    314         output = port.expected_text(
    315             port._filesystem.join(port.layout_tests_dir(), 'passes/text.html'))
     314        output = port.expected_text('passes/text.html')
    316315        self.assertFalse(rebaseliner._diff_baselines(output, output,
    317316                                                     is_image=False))
     
    320319        rebaseliner, filesystem = self.make_rebaseliner('')
    321320        port = rebaseliner._port
    322         image = port.expected_image(
    323             port._filesystem.join(port.layout_tests_dir(), 'passes/image.html'))
     321        image = port.expected_image('passes/image.html')
    324322        self.assertFalse(rebaseliner._diff_baselines(image, image,
    325323                                                     is_image=True))
  • trunk/Tools/Scripts/webkitpy/tool/bot/flakytestreporter.py

    r83614 r90520  
    126126    def _latest_flake_message(self, flaky_result, patch):
    127127        failure_messages = [failure.message() for failure in flaky_result.failures]
    128         flake_message = "The %s just saw %s flake (%s) while processing attachment %s on bug %s." % (self._bot_name, flaky_result.filename, ", ".join(failure_messages), patch.id(), patch.bug_id())
     128        flake_message = "The %s just saw %s flake (%s) while processing attachment %s on bug %s." % (self._bot_name, flaky_result.test_name, ", ".join(failure_messages), patch.id(), patch.bug_id())
    129129        return "%s\n%s" % (flake_message, self._bot_info.summary_text())
    130130
     
    180180        message = "The %s encountered the following flaky tests while processing attachment %s:\n\n" % (self._bot_name, patch.id())
    181181        for flaky_result in flaky_test_results:
    182             flaky_test = flaky_result.filename
     182            flaky_test = flaky_result.test_name
    183183            bug = self._lookup_bug_for_flaky_test(flaky_test)
    184184            latest_flake_message = self._latest_flake_message(flaky_result, patch)
  • trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py

    r89965 r90520  
    105105            results_url = self._results_url_for_test(build, test)
    106106            # Port operates with absolute paths.
    107             absolute_path = os.path.join(port.layout_tests_dir(), test)
    108             expected_file = port.expected_filename(absolute_path, ".txt")
     107            expected_file = port.expected_filename(test, '.txt')
    109108            print test
    110109            self._replace_expectation_with_remote_result(expected_file, results_url)
  • trunk/Tools/Scripts/webkitpy/tool/servers/rebaselineserver.py

    r90410 r90520  
    180180    all_test_baselines = {}
    181181    for baseline_extension in ('.txt', '.checksum', '.png'):
    182         test_baselines = test_config.test_port.expected_baselines(test_path, baseline_extension)
    183         baselines = all_platforms_port.expected_baselines(test_path, baseline_extension, all_baselines=True)
     182        test_baselines = test_config.test_port.expected_baselines(test_file, baseline_extension)
     183        baselines = all_platforms_port.expected_baselines(test_file, baseline_extension, all_baselines=True)
    184184        for platform_directory, expected_filename in baselines:
    185185            if not platform_directory:
Note: See TracChangeset for help on using the changeset viewer.