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

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

Issue 2620883002: Convert Settings.in, CSSValueKeywords.in, SVGCSSValueKeywords.in to json5 (Closed)
Patch Set: Convert CSSProperties.in to json5 format 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions 4 # modification, are permitted provided that the following conditions
5 # are met: 5 # are met:
6 # 6 #
7 # 1. Redistributions of source code must retain the above 7 # 1. Redistributions of source code must retain the above
8 # copyright notice, this list of conditions and the following 8 # copyright notice, this list of conditions and the following
9 # disclaimer. 9 # disclaimer.
10 # 2. Redistributions in binary form must reproduce the above 10 # 2. Redistributions in binary form must reproduce the above
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 self.assertEqual( 127 self.assertEqual(
128 host.filesystem.executable_files, 128 host.filesystem.executable_files,
129 set(['/mock-checkout/third_party/WebKit/LayoutTests/w3c/blink/w3c/di r/has_shebang.txt'])) 129 set(['/mock-checkout/third_party/WebKit/LayoutTests/w3c/blink/w3c/di r/has_shebang.txt']))
130 130
131 def test_ref_test_with_ref_is_copied(self): 131 def test_ref_test_with_ref_is_copied(self):
132 host = MockHost() 132 host = MockHost()
133 host.filesystem = MockFileSystem(files={ 133 host.filesystem = MockFileSystem(files={
134 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h ref="ref-file.html" />test</head></html>', 134 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h ref="ref-file.html" />test</head></html>',
135 '/blink/w3c/dir1/ref-file.html': '<html><head>test</head></html>', 135 '/blink/w3c/dir1/ref-file.html': '<html><head>test</head></html>',
136 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations ': '', 136 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations ': '',
137 '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in' : '', 137 '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.jso n5': '',
138 }) 138 })
139 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) 139 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
140 importer.find_importable_tests() 140 importer.find_importable_tests()
141 self.assertEqual( 141 self.assertEqual(
142 importer.import_list, 142 importer.import_list,
143 [ 143 [
144 { 144 {
145 'copy_list': [ 145 'copy_list': [
146 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'ref-fi le.html'}, 146 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'ref-fi le.html'},
147 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'my-ref -test-expected.html', 'reference_support_info': {}}, 147 {'src': '/blink/w3c/dir1/ref-file.html', 'dest': 'my-ref -test-expected.html', 'reference_support_info': {}},
148 {'src': '/blink/w3c/dir1/my-ref-test.html', 'dest': 'my- ref-test.html'} 148 {'src': '/blink/w3c/dir1/my-ref-test.html', 'dest': 'my- ref-test.html'}
149 ], 149 ],
150 'dirname': '/blink/w3c/dir1', 150 'dirname': '/blink/w3c/dir1',
151 'jstests': 0, 151 'jstests': 0,
152 'reftests': 1, 152 'reftests': 1,
153 'total_tests': 1 153 'total_tests': 1
154 } 154 }
155 ]) 155 ])
156 156
157 def test_ref_test_without_ref_is_skipped(self): 157 def test_ref_test_without_ref_is_skipped(self):
158 host = MockHost() 158 host = MockHost()
159 host.filesystem = MockFileSystem(files={ 159 host.filesystem = MockFileSystem(files={
160 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h ref="not-here.html" /></head></html>', 160 '/blink/w3c/dir1/my-ref-test.html': '<html><head><link rel="match" h ref="not-here.html" /></head></html>',
161 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations ': '', 161 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations ': '',
162 '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in' : '', 162 '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.jso n5': '',
163 }) 163 })
164 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) 164 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
165 importer.find_importable_tests() 165 importer.find_importable_tests()
166 self.assertEqual(importer.import_list, []) 166 self.assertEqual(importer.import_list, [])
167 167
168 def test_should_try_to_convert_positive_cases(self): 168 def test_should_try_to_convert_positive_cases(self):
169 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.css', 'Layou tTests/imported/csswg-test/x')) 169 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.css', 'Layou tTests/imported/csswg-test/x'))
170 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.htm', 'Layou tTests/imported/csswg-test/x')) 170 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.htm', 'Layou tTests/imported/csswg-test/x'))
171 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.html', 'Layo utTests/imported/csswg-test/x')) 171 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.html', 'Layo utTests/imported/csswg-test/x'))
172 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.xht', 'Layou tTests/imported/csswg-test/x')) 172 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.xht', 'Layou tTests/imported/csswg-test/x'))
173 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.xhtml', 'Lay outTests/imported/csswg-test/x')) 173 self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.xhtml', 'Lay outTests/imported/csswg-test/x'))
174 174
175 def test_should_not_try_to_convert_js_test(self): 175 def test_should_not_try_to_convert_js_test(self):
176 self.assertFalse(TestImporter.should_try_to_convert({'is_jstest': True}, 'foo.html', 'LayoutTests/imported/csswg-test/x')) 176 self.assertFalse(TestImporter.should_try_to_convert({'is_jstest': True}, 'foo.html', 'LayoutTests/imported/csswg-test/x'))
177 177
178 def test_should_not_try_to_convert_test_in_wpt(self): 178 def test_should_not_try_to_convert_test_in_wpt(self):
179 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.html', 'Lay outTests/imported/wpt/foo')) 179 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.html', 'Lay outTests/imported/wpt/foo'))
180 180
181 def test_should_not_try_to_convert_other_file_types(self): 181 def test_should_not_try_to_convert_other_file_types(self):
182 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.bar', 'Layo utTests/imported/csswg-test/x')) 182 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.bar', 'Layo utTests/imported/csswg-test/x'))
183 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.js', 'Layou tTests/imported/csswg-test/x')) 183 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.js', 'Layou tTests/imported/csswg-test/x'))
184 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.md', 'Layou tTests/imported/csswg-test/x')) 184 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.md', 'Layou tTests/imported/csswg-test/x'))
185 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.png', 'Layo utTests/imported/csswg-test/x')) 185 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.png', 'Layo utTests/imported/csswg-test/x'))
186 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.svg', 'Layo utTests/imported/csswg-test/x')) 186 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.svg', 'Layo utTests/imported/csswg-test/x'))
187 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.svgz', 'Lay outTests/imported/csswg-test/x')) 187 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.svgz', 'Lay outTests/imported/csswg-test/x'))
OLDNEW
« 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