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

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

Issue 2542963002: W3C Importer: Consolidate and simplify logic for deciding what not to convert. (Closed)
Patch Set: Created 4 years 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_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 338be36f609f191d6a670a5ccb0bc1d1ea1ab539..d98e2099d6edf694a8a02d691d4759ca1ad75ba2 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
@@ -173,3 +173,22 @@ class TestImporterTest(unittest.TestCase):
importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
importer.find_importable_tests()
self.assertEqual(importer.import_list, [])
+
+ def test_should_try_to_convert_positive_cases(self):
+ self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.html', 'LayoutTests/imported/csswg-test/x'))
+ self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.htm', 'LayoutTests/imported/csswg-test/x'))
+ self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.xhtml', 'LayoutTests/imported/csswg-test/x'))
+ self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.xht', 'LayoutTests/imported/csswg-test/x'))
+ self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.css', 'LayoutTests/imported/csswg-test/x'))
+
+ def test_should_not_try_to_convert_js_test(self):
+ self.assertFalse(TestImporter.should_try_to_convert({'is_jstest': True}, 'foo.html', 'LayoutTests/imported/csswg-test/x'))
+
+ def test_should_not_try_to_convert_test_in_wpt(self):
+ self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.html', 'LayoutTests/imported/wpt/foo'))
+
+ def test_should_not_try_to_convert_other_file_types(self):
+ self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.svgz', 'LayoutTests/imported/csswg-test/x'))
Manuel Rego 2016/12/01 22:00:52 Nit: Maybe add SVG too, which is much more common.
qyearsley 2016/12/01 22:27:53 Done
+ self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.js', 'LayoutTests/imported/csswg-test/x'))
+ self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.md', 'LayoutTests/imported/csswg-test/x'))
+ self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.bar', 'LayoutTests/imported/csswg-test/x'))

Powered by Google App Engine
This is Rietveld 408576698