| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. 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 are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 import unittest | 30 import unittest |
| 31 | 31 |
| 32 from webkitpy.common.system.systemhost_mock import MockSystemHost | 32 from webkitpy.common.system.systemhost_mock import MockSystemHost |
| 33 from webkitpy.layout_tests.controllers.test_result_writer import write_test_resu
lt | 33 from webkitpy.layout_tests.controllers.test_result_writer import write_test_resu
lt |
| 34 from webkitpy.layout_tests.port.driver import DriverOutput | 34 from webkitpy.layout_tests.port.driver import DriverOutput |
| 35 from webkitpy.layout_tests.port.test import TestPort | 35 from webkitpy.layout_tests.port.test import TestPort |
| 36 from webkitpy.layout_tests.models import test_failures | 36 from webkitpy.layout_tests.models import test_failures |
| 37 | 37 |
| 38 | 38 |
| 39 class TestResultWriterTests(unittest.TestCase): | 39 class TestResultWriterTests(unittest.TestCase): |
| 40 |
| 40 def run_test(self, failures=None, files=None): | 41 def run_test(self, failures=None, files=None): |
| 41 failures = failures or [] | 42 failures = failures or [] |
| 42 host = MockSystemHost() | 43 host = MockSystemHost() |
| 43 host.filesystem.files = files or {} | 44 host.filesystem.files = files or {} |
| 44 port = TestPort(host=host, port_name='test-mac-snowleopard', options=opt
parse.Values()) | 45 port = TestPort(host=host, port_name='test-mac-snowleopard', options=opt
parse.Values()) |
| 45 actual_output = DriverOutput(text='', image=None, image_hash=None, audio
=None) | 46 actual_output = DriverOutput(text='', image=None, image_hash=None, audio
=None) |
| 46 expected_output = DriverOutput(text='', image=None, image_hash=None, aud
io=None) | 47 expected_output = DriverOutput(text='', image=None, image_hash=None, aud
io=None) |
| 47 write_test_result(host.filesystem, port, '/tmp', 'foo.html', actual_outp
ut, expected_output, failures) | 48 write_test_result(host.filesystem, port, '/tmp', 'foo.html', actual_outp
ut, expected_output, failures) |
| 48 return host.filesystem.written_files | 49 return host.filesystem.written_files |
| 49 | 50 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 68 def test_reference_is_missing(self): | 69 def test_reference_is_missing(self): |
| 69 failure = test_failures.FailureReftestMismatch() | 70 failure = test_failures.FailureReftestMismatch() |
| 70 failure.reference_filename = 'notfound.html' | 71 failure.reference_filename = 'notfound.html' |
| 71 written_files = self.run_test(failures=[failure], files={}) | 72 written_files = self.run_test(failures=[failure], files={}) |
| 72 self.assertEqual(written_files, {}) | 73 self.assertEqual(written_files, {}) |
| 73 | 74 |
| 74 failure = test_failures.FailureReftestMismatchDidNotOccur() | 75 failure = test_failures.FailureReftestMismatchDidNotOccur() |
| 75 failure.reference_filename = 'notfound.html' | 76 failure.reference_filename = 'notfound.html' |
| 76 written_files = self.run_test(failures=[failure], files={}) | 77 written_files = self.run_test(failures=[failure], files={}) |
| 77 self.assertEqual(written_files, {}) | 78 self.assertEqual(written_files, {}) |
| OLD | NEW |