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

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

Issue 2628913003: On W3C test import, always skip large files that may fail to upload. (Closed)
Patch Set: Created 3 years, 11 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_importer.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
index 12b0235808a21a6dfc033474e8b8d16febfdfa49..512d0bde48b6b05e396c0cb7fe70b4a5b3201810 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
@@ -82,6 +82,7 @@ from webkitpy.w3c.test_converter import convert_for_webkit
# This limit is here because the Windows builders cannot create paths that are
# longer than the Windows max path length (260). See http://crbug.com/609871.
MAX_PATH_LENGTH = 125
+MAX_FILE_SIZE_BYTES = 800 * 1024
_log = logging.getLogger(__name__)
@@ -374,7 +375,8 @@ class TestImporter(object):
dest_dir: Path to the directory where the file should be copied.
Returns:
- The path to the new file, relative to the Blink root (//third_party/WebKit).
+ The path to the new file, relative to the Blink root,
+ or None if the file should not be copied.
"""
source_path = self.filesystem.normpath(file_to_copy['src'])
dest_path = self.filesystem.join(dest_dir, file_to_copy['dest'])
@@ -387,6 +389,10 @@ class TestImporter(object):
_log.error('%s not found. Possible error in the test.', source_path)
return None
+ if self.filesystem.getsize(source_path) > MAX_FILE_SIZE_BYTES:
+ _log.error('%s is too large (%d bytes)', source_path, self.filesystem.getsize(source_path))
+ return None
+
if file_to_copy.get('reference_support_info'):
reference_support_info = file_to_copy['reference_support_info']
else:

Powered by Google App Engine
This is Rietveld 408576698