Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py

Issue 2722843002: Remove long path check in test import process. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py
index f6df0710c43422531e793bd88f4a633b6adf1761..7e65dc1029fdaeed86150975b7484e5708e735a1 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier.py
@@ -33,7 +33,6 @@ a local W3C repository source directory into a destination directory.
import logging
import mimetypes
-import os
import re
from webkitpy.common.webkit_finder import WebKitFinder
@@ -41,14 +40,6 @@ from webkitpy.layout_tests.models.test_expectations import TestExpectationParser
from webkitpy.w3c.test_parser import TestParser
from webkitpy.w3c.test_converter import convert_for_webkit
-# Maximum length of import path relative to the upstream repository base.
-# This limit is here because the Windows builders cannot create paths that are
-# longer than the Windows max path length (260). If the absolute path to the
-# destination directory is up to 100 characters on Windows, then that would
-# give us 160 characters from the base of the upstream repo.
-# See: http://crbug.com/609871.
-MAX_PATH_LENGTH = 160
-
_log = logging.getLogger(__name__)
@@ -60,7 +51,7 @@ class TestCopier(object):
Args:
host: An instance of Host.
source_repo_path: Path to the local checkout of a
- web-platform-tests or csswg-test repository.
+ web-platform-tests or csswg-test repository.
dest_dir_name: The name of the directory under the layout tests
directory where imported tests should be copied to.
TODO(qyearsley): This can be made into a constant.
@@ -157,10 +148,6 @@ class TestCopier(object):
_log.debug('Skipping: %s', path_full)
_log.debug(' Reason: This file may cause Chromium presubmit to fail.')
continue
- if self.path_too_long(path_full):
- _log.warning('Skipping: %s', path_full)
- _log.warning(' Reason: Long path. Max length %d; see http://crbug.com/609871.', MAX_PATH_LENGTH)
- continue
mimetype = mimetypes.guess_type(path_full)
if ('html' not in str(mimetype[0]) and
@@ -186,37 +173,18 @@ class TestCopier(object):
_log.warning(' Reason: Ref file "%s" was not found.', ref_path_full)
continue
- if self.is_wpt:
- if self.path_too_long(ref_path_full):
- _log.warning('Skipping: %s', path_full)
- _log.warning(' Reason: Ref file path length would be too long: %s.', ref_path_full)
- _log.warning(' Max length %d; see http://crbug.com/609871.', MAX_PATH_LENGTH)
- continue
- # For WPT, we don't need to rename the reference file to
- # WebKit style name.
- # We don't ask to copy ref_path_full here because this
- # filesystem walk will find the reference file, and copy
- # it as a non-test file.
- else:
+ if not self.is_wpt:
+ # For csswg-test, we still need to add a ref file
+ # using WebKit naming conventions. See crbug.com/268729.
+ # FIXME: Remove this when csswg-test is merged into wpt.
test_basename = self.filesystem.basename(test_info['test'])
- # Add the ref file, following WebKit style.
- # FIXME: Ideally we'd support reading the metadata
- # directly rather than relying on a naming convention.
- # Using a naming convention creates duplicate copies of the
- # reference files (http://crrev.com/268729).
ref_file = self.filesystem.splitext(test_basename)[0] + '-expected'
- # Make sure to use the extension from the *reference*, not
- # from the test, because at least flexbox tests use XHTML
- # references but HTML tests.
ref_file += self.filesystem.splitext(ref_path_full)[1]
-
- if self.path_too_long(path_full.replace(filename, ref_file)):
- _log.warning('Skipping: %s', path_full)
- _log.warning(' Reason: Ref file path length would be too long: %s.', ref_file)
- _log.warning(' Max length %d; see http://crbug.com/609871.', MAX_PATH_LENGTH)
- continue
- copy_list.append({'src': test_info['reference'], 'dest': ref_file,
- 'reference_support_info': test_info['reference_support_info']})
+ copy_list.append({
+ 'src': test_info['reference'],
+ 'dest': ref_file,
+ 'reference_support_info': test_info['reference_support_info'],
+ })
reftests += 1
total_tests += 1
@@ -360,15 +328,3 @@ class TestCopier(object):
# Only HTML, XHTML and CSS files should be converted.
mimetype, _ = mimetypes.guess_type(source_path)
return mimetype in ('text/html', 'application/xhtml+xml', 'text/css')
-
- def path_too_long(self, source_path):
- """Checks whether a source path is too long to import.
-
- Args:
- Absolute path of file to be imported.
-
- Returns:
- True if the path is too long to import, False if it's OK.
- """
- path_from_repo_base = os.path.relpath(source_path, self.source_repo_path)
- return len(path_from_repo_base) > MAX_PATH_LENGTH

Powered by Google App Engine
This is Rietveld 408576698