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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.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
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
index 1ff68fe111388b38c0b9723923e9b1a969df8daf..4da4391783f8ff67a884f8ca4bdf826f3f408351 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
@@ -32,6 +32,7 @@ from webkitpy.common.host_mock import MockHost
from webkitpy.common.system.executive_mock import MockExecutive, ScriptError
from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.w3c.test_importer import TestImporter
+from webkitpy.common.system.log_testing import LoggingTestCase
FAKE_SOURCE_REPO_DIR = '/blink'
@@ -49,7 +50,7 @@ FAKE_FILES = {
}
-class TestImporterTest(unittest.TestCase):
+class TestImporterTest(LoggingTestCase):
@staticmethod
def options(**kwargs):
@@ -165,6 +166,29 @@ class TestImporterTest(unittest.TestCase):
importer.find_importable_tests()
self.assertEqual(importer.import_list, [])
+ def test_large_files_are_skipped(self):
+ host = MockHost()
+ host.filesystem = MockFileSystem(files={
+ '/blink/w3c/dir1/my-large-test.html': '...',
+ '/blink/w3c/dir1/my-small-test.html': '...',
+ '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations': '',
+ '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in': '',
+ })
+
+ def getsize(path):
+ if 'large' in path:
+ return 1000000
+ return 100
+ host.filesystem.getsize = getsize
+
+ importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
+ importer.do_import()
+ self.assertIn('ERROR: /blink/w3c/dir1/my-large-test.html is too large (1000000 bytes)\n', self.logMessages())
+ self.assertTrue(host.filesystem.exists(
+ '/mock-checkout/third_party/WebKit/LayoutTests/w3c/blink/w3c/dir1/my-small-test.html'))
+ self.assertFalse(host.filesystem.exists(
+ '/mock-checkout/third_party/WebKit/LayoutTests/w3c/blink/w3c/dir1/my-large-test.html'))
+
def test_should_try_to_convert_positive_cases(self):
self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.css', 'LayoutTests/imported/csswg-test/x'))
self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.htm', 'LayoutTests/imported/csswg-test/x'))
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698