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

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

Issue 2598743002: When importing w3c repos, convert CRLF line endings. (Closed)
Patch Set: Created 3 years, 12 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 def test_files_with_shebang_are_made_executable(self): 122 def test_files_with_shebang_are_made_executable(self):
123 host = MockHost() 123 host = MockHost()
124 host.filesystem = MockFileSystem(files=FAKE_FILES) 124 host.filesystem = MockFileSystem(files=FAKE_FILES)
125 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) 125 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
126 importer.do_import() 126 importer.do_import()
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_crlf_line_endings_are_transformed(self):
132 host = MockHost()
133 host.filesystem = MockFileSystem(files={
134 '/blink/w3c/dir/binary.x': '\x81\x05\r\nX\x00\x001\x81\x05\r\n\x00',
135 '/blink/w3c/dir/dos.txt': 'xxx\r\nyyy\r\n',
136 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations ': '',
137 })
138 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
139 importer.do_import()
140 self.assertEqual(
141 host.filesystem.files['/mock-checkout/third_party/WebKit/LayoutTests /w3c/blink/w3c/dir/dos.txt'],
142 'xxx\nyyy\n')
143 self.assertEqual(
144 host.filesystem.files['/mock-checkout/third_party/WebKit/LayoutTests /w3c/blink/w3c/dir/binary.x'],
145 '\x81\x05\r\nX\x00\x001\x81\x05\r\n\x00')
146
131 def test_ref_test_with_ref_is_copied(self): 147 def test_ref_test_with_ref_is_copied(self):
132 host = MockHost() 148 host = MockHost()
133 host.filesystem = MockFileSystem(files={ 149 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>', 150 '/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>', 151 '/blink/w3c/dir1/ref-file.html': '<html><head>test</head></html>',
136 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations ': '', 152 '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations ': '',
137 '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in' : '', 153 '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in' : '',
138 }) 154 })
139 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) 155 importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options())
140 importer.find_importable_tests() 156 importer.find_importable_tests()
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 def test_should_not_try_to_convert_test_in_wpt(self): 194 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')) 195 self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.html', 'Lay outTests/imported/wpt/foo'))
180 196
181 def test_should_not_try_to_convert_other_file_types(self): 197 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')) 198 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')) 199 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')) 200 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')) 201 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')) 202 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')) 203 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