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

Side by Side Diff: sky/tools/webkitpy/layout_tests/run_webkit_tests_unittest.py

Issue 802573002: Prepare python code for reftests. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze ged 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze ged
3 # Copyright (C) 2011 Apple Inc. All rights reserved. 3 # Copyright (C) 2011 Apple Inc. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 743
744 def test_reftest_run(self): 744 def test_reftest_run(self):
745 tests_run = get_tests_run(['passes/reftest.html']) 745 tests_run = get_tests_run(['passes/reftest.html'])
746 self.assertEqual(['passes/reftest.html'], tests_run) 746 self.assertEqual(['passes/reftest.html'], tests_run)
747 747
748 def test_reftest_run_reftests_if_pixel_tests_are_disabled(self): 748 def test_reftest_run_reftests_if_pixel_tests_are_disabled(self):
749 tests_run = get_tests_run(['--no-pixel-tests', 'passes/reftest.html']) 749 tests_run = get_tests_run(['--no-pixel-tests', 'passes/reftest.html'])
750 self.assertEqual(['passes/reftest.html'], tests_run) 750 self.assertEqual(['passes/reftest.html'], tests_run)
751 751
752 def test_reftest_expected_html_should_be_ignored(self): 752 def test_reftest_expected_html_should_be_ignored(self):
753 tests_run = get_tests_run(['passes/reftest-expected.html']) 753 tests_run = get_tests_run(['passes/reftest-expected.sky'])
754 self.assertEqual([], tests_run) 754 self.assertEqual([], tests_run)
755 755
756 def test_reftest_driver_should_run_expected_html(self): 756 def test_reftest_driver_should_run_expected_html(self):
757 tests_run = get_test_results(['passes/reftest.html']) 757 tests_run = get_test_results(['passes/reftest.html'])
758 self.assertEqual(tests_run[0].references, ['passes/reftest-expected.html ']) 758 self.assertEqual(tests_run[0].references, ['passes/reftest-expected.sky' ])
759 759
760 def test_reftest_driver_should_run_expected_mismatch_html(self): 760 def test_reftest_driver_should_run_expected_mismatch_html(self):
761 tests_run = get_test_results(['passes/mismatch.html']) 761 tests_run = get_test_results(['passes/mismatch.html'])
762 self.assertEqual(tests_run[0].references, ['passes/mismatch-expected-mis match.html']) 762 self.assertEqual(tests_run[0].references, ['passes/mismatch-expected-mis match.sky'])
763 763
764 def test_reftest_should_not_use_naming_convention_if_not_listed_in_reftestli st(self): 764 def test_reftest_should_not_use_naming_convention_if_not_listed_in_reftestli st(self):
765 host = MockHost() 765 host = MockHost()
766 _, err, _ = logging_run(['--no-show-results', 'reftests/foo/'], tests_in cluded=True, host=host) 766 _, err, _ = logging_run(['--no-show-results', 'reftests/foo/'], tests_in cluded=True, host=host)
767 results = parse_full_results(host.filesystem.read_text_file('/tmp/layout -test-results/full_results.json')) 767 results = parse_full_results(host.filesystem.read_text_file('/tmp/layout -test-results/full_results.json'))
768 768
769 self.assertEqual(results["tests"]["reftests"]["foo"]["unlistedtest.html" ]["actual"], "MISSING"), 769 self.assertEqual(results["tests"]["reftests"]["foo"]["unlistedtest.html" ]["actual"], "MISSING"),
770 self.assertEqual(results["num_regressions"], 5) 770 self.assertEqual(results["num_regressions"], 5)
771 self.assertEqual(results["num_flaky"], 0) 771 self.assertEqual(results["num_flaky"], 0)
772 772
773 def test_reftest_crash(self): 773 def test_reftest_crash(self):
774 test_results = get_test_results(['failures/unexpected/crash-reftest.html ']) 774 test_results = get_test_results(['failures/unexpected/crash-reftest.html '])
775 # The list of references should be empty since the test crashed and we d idn't run any references. 775 # The list of references should be empty since the test crashed and we d idn't run any references.
776 self.assertEqual(test_results[0].references, []) 776 self.assertEqual(test_results[0].references, [])
777 777
778 def test_reftest_with_virtual_reference(self): 778 def test_reftest_with_virtual_reference(self):
779 _, err, _ = logging_run(['--details', 'virtual/passes/reftest.html'], te sts_included=True) 779 _, err, _ = logging_run(['--details', 'virtual/passes/reftest.html'], te sts_included=True)
780 self.assertTrue('ref: virtual/passes/reftest-expected.html' in err.getva lue()) 780 self.assertTrue('ref: virtual/passes/reftest-expected.sky' in err.getval ue())
781 781
782 def test_additional_platform_directory(self): 782 def test_additional_platform_directory(self):
783 self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/fo o'])) 783 self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/fo o']))
784 self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/.. /foo'])) 784 self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/.. /foo']))
785 self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/fo o', '--additional-platform-directory', '/tmp/bar'])) 785 self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/fo o', '--additional-platform-directory', '/tmp/bar']))
786 self.assertTrue(passing_run(['--additional-platform-directory', 'foo'])) 786 self.assertTrue(passing_run(['--additional-platform-directory', 'foo']))
787 787
788 def test_additional_expectations(self): 788 def test_additional_expectations(self):
789 host = MockHost() 789 host = MockHost()
790 host.filesystem.write_text_file('/tmp/overrides.txt', 'Bug(x) failures/u nexpected/mismatch.html [ ImageOnlyFailure ]\n') 790 host.filesystem.write_text_file('/tmp/overrides.txt', 'Bug(x) failures/u nexpected/mismatch.html [ ImageOnlyFailure ]\n')
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 stderr = StringIO.StringIO() 1052 stderr = StringIO.StringIO()
1053 res = run_webkit_tests.main(['--platform', 'test', '--exit-after-n-failu res', '1', 1053 res = run_webkit_tests.main(['--platform', 'test', '--exit-after-n-failu res', '1',
1054 'failures/unexpected/missing_text.html', 1054 'failures/unexpected/missing_text.html',
1055 'failures/unexpected/missing_image.html'], 1055 'failures/unexpected/missing_image.html'],
1056 stdout, stderr) 1056 stdout, stderr)
1057 self.assertEqual(res, test_run_results.EARLY_EXIT_STATUS) 1057 self.assertEqual(res, test_run_results.EARLY_EXIT_STATUS)
1058 self.assertEqual(stdout.getvalue(), 1058 self.assertEqual(stdout.getvalue(),
1059 ('\n' 1059 ('\n'
1060 'Regressions: Unexpected missing results (1)\n' 1060 'Regressions: Unexpected missing results (1)\n'
1061 ' failures/unexpected/missing_image.html [ Missing ]\n\n')) 1061 ' failures/unexpected/missing_image.html [ Missing ]\n\n'))
OLDNEW
« no previous file with comments | « sky/tools/webkitpy/layout_tests/port/test.py ('k') | sky/tools/webkitpy/tool/commands/rebaseline_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698