|
Lines 195-201
class TestRebaseliner(unittest.TestCase):
a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec1
|
| 195 |
zip_factory = test_zip_factory() |
195 |
zip_factory = test_zip_factory() |
| 196 |
|
196 |
|
| 197 |
# FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently. |
197 |
# FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently. |
| 198 |
filesystem.chdir("/test.checkout") |
198 |
filesystem.chdir(filesystem.dirname(host_port_obj.layout_tests_dir())) |
| 199 |
|
199 |
|
| 200 |
rebaseliner = rebaseline_chromium_webkit_tests.Rebaseliner(host, host_port_obj, |
200 |
rebaseliner = rebaseline_chromium_webkit_tests.Rebaseliner(host, host_port_obj, |
| 201 |
target_port_obj, platform, options, url_fetcher, zip_factory) |
201 |
target_port_obj, platform, options, url_fetcher, zip_factory) |
|
Lines 227-260
class TestRebaseliner(unittest.TestCase):
a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec2
|
| 227 |
"BUGX REBASELINE MAC : failures/expected/image.html = IMAGE") |
227 |
"BUGX REBASELINE MAC : failures/expected/image.html = IMAGE") |
| 228 |
|
228 |
|
| 229 |
rebaseliner.run() |
229 |
rebaseliner.run() |
|
|
230 |
layout_test_dir = rebaseliner._port.layout_tests_dir() |
| 230 |
# We expect to have written 13 files over the course of this rebaseline: |
231 |
# We expect to have written 13 files over the course of this rebaseline: |
| 231 |
# *) 3 files in /__im_tmp for the extracted archive members |
232 |
# *) 3 files in /__im_tmp for the extracted archive members |
| 232 |
# *) 3 new baselines under '/test.checkout/LayoutTests' |
233 |
# *) 3 new baselines under layout_test_dir |
| 233 |
# *) 4 files in /tmp for the new and old baselines in the result file |
234 |
# *) 4 files in /tmp for the new and old baselines in the result file |
| 234 |
# (-{old,new}.{txt,png} |
235 |
# (-{old,new}.{txt,png} |
| 235 |
# *) 1 text diff in /tmp for the result file (-diff.txt). |
236 |
# *) 1 text diff in /tmp for the result file (-diff.txt). |
| 236 |
# *) 1 image diff in /tmp for the result file (-diff.png). |
237 |
# *) 1 image diff in /tmp for the result file (-diff.png). |
| 237 |
# *) 1 updated test_expectations file |
238 |
# *) 1 updated test_expectations file |
| 238 |
self.assertEqual(len(filesystem.written_files), 13) |
239 |
self.assertEqual(len(filesystem.written_files), 13) |
| 239 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum') |
240 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum') |
| 240 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png') |
241 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png') |
| 241 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt') |
242 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt') |
| 242 |
|
243 |
|
| 243 |
def test_all_platforms(self): |
244 |
def test_all_platforms(self): |
| 244 |
rebaseliner, filesystem = self.make_rebaseliner( |
245 |
rebaseliner, filesystem = self.make_rebaseliner( |
| 245 |
"BUGX REBASELINE : failures/expected/image.html = IMAGE") |
246 |
"BUGX REBASELINE : failures/expected/image.html = IMAGE") |
|
|
247 |
layout_test_dir = rebaseliner._port.layout_tests_dir() |
| 246 |
rebaseliner.run() |
248 |
rebaseliner.run() |
| 247 |
# See comment in test_one_platform for an explanation of the 13 written tests. |
249 |
# See comment in test_one_platform for an explanation of the 13 written tests. |
| 248 |
# Note that even though the rebaseline is marked for all platforms, each |
250 |
# Note that even though the rebaseline is marked for all platforms, each |
| 249 |
# rebaseliner only ever does one. |
251 |
# rebaseliner only ever does one. |
| 250 |
self.assertEqual(len(filesystem.written_files), 13) |
252 |
self.assertEqual(len(filesystem.written_files), 13) |
| 251 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum') |
253 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum') |
| 252 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png') |
254 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png') |
| 253 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt') |
255 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt') |
| 254 |
|
256 |
|
| 255 |
def test_png_file_with_comment(self): |
257 |
def test_png_file_with_comment(self): |
| 256 |
rebaseliner, filesystem = self.make_rebaseliner( |
258 |
rebaseliner, filesystem = self.make_rebaseliner( |
| 257 |
"BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE") |
259 |
"BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE") |
|
|
260 |
layout_test_dir = rebaseliner._port.layout_tests_dir() |
| 258 |
compile_success = rebaseliner._compile_rebaselining_tests() |
261 |
compile_success = rebaseliner._compile_rebaselining_tests() |
| 259 |
self.assertTrue(compile_success) |
262 |
self.assertTrue(compile_success) |
| 260 |
self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests) |
263 |
self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests) |
|
Lines 262-277
class TestRebaseliner(unittest.TestCase):
a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec3
|
| 262 |
# There is one less file written than |test_one_platform| because we only |
265 |
# There is one less file written than |test_one_platform| because we only |
| 263 |
# write 2 expectations (the png and the txt file). |
266 |
# write 2 expectations (the png and the txt file). |
| 264 |
self.assertEqual(len(filesystem.written_files), 12) |
267 |
self.assertEqual(len(filesystem.written_files), 12) |
| 265 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789') |
268 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789') |
| 266 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt') |
269 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt') |
| 267 |
self.assertFalse(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None)) |
270 |
self.assertFalse(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None)) |
| 268 |
|
271 |
|
| 269 |
def test_png_file_with_comment_remove_old_checksum(self): |
272 |
def test_png_file_with_comment_remove_old_checksum(self): |
| 270 |
rebaseliner, filesystem = self.make_rebaseliner( |
273 |
rebaseliner, filesystem = self.make_rebaseliner( |
| 271 |
"BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE") |
274 |
"BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE") |
| 272 |
filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'] = 'old' |
275 |
layout_test_dir = rebaseliner._port.layout_tests_dir() |
| 273 |
filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum'] = 'old' |
276 |
filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'] = 'old' |
| 274 |
filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'] = 'old' |
277 |
filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum'] = 'old' |
|
|
278 |
filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'] = 'old' |
| 275 |
|
279 |
|
| 276 |
compile_success = rebaseliner._compile_rebaselining_tests() |
280 |
compile_success = rebaseliner._compile_rebaselining_tests() |
| 277 |
self.assertTrue(compile_success) |
281 |
self.assertTrue(compile_success) |
|
Lines 280-302
class TestRebaseliner(unittest.TestCase):
a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec4
|
| 280 |
# There is one more file written than |test_png_file_with_comment_remove_old_checksum| |
284 |
# There is one more file written than |test_png_file_with_comment_remove_old_checksum| |
| 281 |
# because we also delete the old checksum. |
285 |
# because we also delete the old checksum. |
| 282 |
self.assertEqual(len(filesystem.written_files), 13) |
286 |
self.assertEqual(len(filesystem.written_files), 13) |
| 283 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789') |
287 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789') |
| 284 |
self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt') |
288 |
self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt') |
| 285 |
self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None) |
289 |
self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None) |
| 286 |
|
290 |
|
| 287 |
def test_png_file_with_comment_as_duplicate(self): |
291 |
def test_png_file_with_comment_as_duplicate(self): |
| 288 |
rebaseliner, filesystem = self.make_rebaseliner( |
292 |
rebaseliner, filesystem = self.make_rebaseliner( |
| 289 |
"BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE") |
293 |
"BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE") |
| 290 |
filesystem.files['/test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.png'] = 'tEXtchecksum\x000123456789' |
294 |
layout_test_dir = rebaseliner._port.layout_tests_dir() |
| 291 |
filesystem.files['/test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.txt'] = 'png-comment-txt' |
295 |
filesystem.files[layout_test_dir + '/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.png'] = 'tEXtchecksum\x000123456789' |
|
|
296 |
filesystem.files[layout_test_dir + '/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.txt'] = 'png-comment-txt' |
| 292 |
|
297 |
|
| 293 |
compile_success = rebaseliner._compile_rebaselining_tests() |
298 |
compile_success = rebaseliner._compile_rebaselining_tests() |
| 294 |
self.assertTrue(compile_success) |
299 |
self.assertTrue(compile_success) |
| 295 |
self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests) |
300 |
self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests) |
| 296 |
rebaseliner.run() |
301 |
rebaseliner.run() |
| 297 |
self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png', None), None) |
302 |
self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png', None), None) |
| 298 |
self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt', None), None) |
303 |
self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt', None), None) |
| 299 |
self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None) |
304 |
self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None) |
| 300 |
|
305 |
|
| 301 |
def test_diff_baselines_txt(self): |
306 |
def test_diff_baselines_txt(self): |
| 302 |
rebaseliner, filesystem = self.make_rebaseliner("") |
307 |
rebaseliner, filesystem = self.make_rebaseliner("") |
|
Lines 331-337
class TestRealMain(unittest.TestCase):
a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec5
|
| 331 |
zip_factory = test_zip_factory() |
336 |
zip_factory = test_zip_factory() |
| 332 |
|
337 |
|
| 333 |
# FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently. |
338 |
# FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently. |
| 334 |
filesystem.chdir("/test.checkout") |
339 |
filesystem.chdir(filesystem.dirname(host_port_obj.layout_tests_dir())) |
| 335 |
|
340 |
|
| 336 |
oc = outputcapture.OutputCapture() |
341 |
oc = outputcapture.OutputCapture() |
| 337 |
oc.capture_output() |
342 |
oc.capture_output() |