Commit 961d36cf authored by pdr@chromium.org's avatar pdr@chromium.org

Fix reftest crash logs

This patch fixes a long-standing bug where crashing reftests would not
show some crash logs on the layout tests results page.

single_test_runner.py has an optimization to not run reftests when
the base test crashes. This optimization accidentally failed to write
crash logs (done through write_test_result(...)) as well. This patch
fixes this bug and adds a small test.

Review URL: https://codereview.chromium.org/1312693002

git-svn-id: svn://svn.chromium.org/blink/trunk@201147 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 09030925
......@@ -368,7 +368,9 @@ class SingleTestRunner(object):
# This can save a lot of execution time if we have a lot of crashes or timeouts.
if test_output.crash or test_output.timeout:
expected_driver_output = DriverOutput(text=None, image=None, image_hash=None, audio=None)
return self._compare_output(expected_driver_output, test_output)
test_result = self._compare_output(expected_driver_output, test_output)
test_result_writer.write_test_result(self._filesystem, self._port, self._results_directory, self._test_name, test_output, reference_output, test_result.failures)
return test_result
# A reftest can have multiple match references and multiple mismatch references;
# the test fails if any mismatch matches and all of the matches don't match.
......
......@@ -643,6 +643,12 @@ class TestDriver(Driver):
crash_logs = CrashLogs(self._port.host)
crash_log = crash_logs.find_newest_log(crashed_process_name, None) or ''
if 'crash-reftest.html' in test_name:
crashed_process_name = self._port.driver_name()
crashed_pid = 3
crash = True
crash_log = 'reftest crash log'
if stop_when_done:
self.stop()
......
......@@ -467,6 +467,12 @@ class RunTest(unittest.TestCase, StreamTestingMixin):
self.assertEqual(host.filesystem.read_text_file('/tmp/layout-test-results/passes/error-stderr.txt'),
'stuff going to stderr')
def test_reftest_crash_log_is_saved(self):
host = MockHost()
self.assertTrue(logging_run(['failures/unexpected/crash-reftest.html'], tests_included=True, host=host))
self.assertEqual(host.filesystem.read_text_file('/tmp/layout-test-results/failures/unexpected/crash-reftest-crash-log.txt'),
'reftest crash log')
def test_test_list(self):
host = MockHost()
filename = '/tmp/foo.txt'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment