| OLD | NEW |
| 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 14 matching lines...) Expand all Loading... |
| 25 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 26 # SUCH DAMAGE. | 26 # SUCH DAMAGE. |
| 27 | 27 |
| 28 import os | 28 import os |
| 29 import unittest | 29 import unittest |
| 30 | 30 |
| 31 from webkitpy.common.host_mock import MockHost | 31 from webkitpy.common.host_mock import MockHost |
| 32 from webkitpy.common.system.outputcapture import OutputCapture | 32 from webkitpy.common.system.outputcapture import OutputCapture |
| 33 from webkitpy.w3c.test_parser import TestParser | 33 from webkitpy.w3c.test_parser import TestParser |
| 34 | 34 |
| 35 |
| 35 class TestParserTest(unittest.TestCase): | 36 class TestParserTest(unittest.TestCase): |
| 36 | 37 |
| 37 def test_analyze_test_reftest_one_match(self): | 38 def test_analyze_test_reftest_one_match(self): |
| 38 test_html = """<head> | 39 test_html = """<head> |
| 39 <link rel="match" href="green-box-ref.xht" /> | 40 <link rel="match" href="green-box-ref.xht" /> |
| 40 </head> | 41 </head> |
| 41 """ | 42 """ |
| 42 test_path = '/some/madeup/path/' | 43 test_path = '/some/madeup/path/' |
| 43 parser = TestParser(test_path + 'somefile.html', MockHost()) | 44 parser = TestParser(test_path + 'somefile.html', MockHost()) |
| 44 test_info = parser.analyze_test(test_contents=test_html) | 45 test_info = parser.analyze_test(test_contents=test_html) |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 # FIXME: use a mock filesystem | 212 # FIXME: use a mock filesystem |
| 212 parser = TestParser(os.path.join(os.path.dirname(__file__), 'test_parser
.py'), MockHost()) | 213 parser = TestParser(os.path.join(os.path.dirname(__file__), 'test_parser
.py'), MockHost()) |
| 213 test_info = parser.analyze_test() | 214 test_info = parser.analyze_test() |
| 214 self.assertEqual(test_info, None, 'no tests should have been found in th
is file') | 215 self.assertEqual(test_info, None, 'no tests should have been found in th
is file') |
| 215 | 216 |
| 216 def test_parser_initialization_non_existent_file(self): | 217 def test_parser_initialization_non_existent_file(self): |
| 217 parser = TestParser('some/bogus/path.html', MockHost()) | 218 parser = TestParser('some/bogus/path.html', MockHost()) |
| 218 self.assertEqual(parser.filename, 'some/bogus/path.html') | 219 self.assertEqual(parser.filename, 'some/bogus/path.html') |
| 219 self.assertIsNone(parser.test_doc) | 220 self.assertIsNone(parser.test_doc) |
| 220 self.assertIsNone(parser.ref_doc) | 221 self.assertIsNone(parser.ref_doc) |
| OLD | NEW |