| OLD | NEW |
| 1 # Copyright (c) 2010, Google Inc. All rights reserved. | 1 # Copyright (c) 2010, 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 11 matching lines...) Expand all Loading... |
| 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 import unittest | 29 import unittest |
| 30 | 30 |
| 31 from webkitpy.common.net.layouttestresults import LayoutTestResults | 31 from webkitpy.common.net.layouttestresults import LayoutTestResults |
| 32 from webkitpy.common.system.outputcapture import OutputCapture | |
| 33 from webkitpy.layout_tests.models import test_results | |
| 34 from webkitpy.layout_tests.models import test_failures | |
| 35 from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup | |
| 36 | 32 |
| 37 | 33 |
| 38 class LayoutTestResultsTest(unittest.TestCase): | 34 class LayoutTestResultsTest(unittest.TestCase): |
| 39 # The real files have no whitespace, but newlines make this much more readab
le. | 35 # The real files have no whitespace, but newlines make this much more readab
le. |
| 40 example_full_results_json = """ADD_RESULTS({ | 36 example_full_results_json = """ADD_RESULTS({ |
| 41 "tests": { | 37 "tests": { |
| 42 "fast": { | 38 "fast": { |
| 43 "dom": { | 39 "dom": { |
| 44 "prototype-inheritance.html": { | 40 "prototype-inheritance.html": { |
| 45 "expected": "PASS", | 41 "expected": "PASS", |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 self.assertFalse(LayoutTestResults.results_from_string('ADD_RESULTS({"te
sts":{},"interrupted":false});').run_was_interrupted()) | 95 self.assertFalse(LayoutTestResults.results_from_string('ADD_RESULTS({"te
sts":{},"interrupted":false});').run_was_interrupted()) |
| 100 | 96 |
| 101 def test_chromium_revision(self): | 97 def test_chromium_revision(self): |
| 102 self.assertEqual(LayoutTestResults.results_from_string(self.example_full
_results_json).chromium_revision(), 1234) | 98 self.assertEqual(LayoutTestResults.results_from_string(self.example_full
_results_json).chromium_revision(), 1234) |
| 103 | 99 |
| 104 def test_actual_results(self): | 100 def test_actual_results(self): |
| 105 results = LayoutTestResults.results_from_string(self.example_full_result
s_json) | 101 results = LayoutTestResults.results_from_string(self.example_full_result
s_json) |
| 106 self.assertEqual(results.actual_results("fast/dom/prototype-banana.html"
), "PASS") | 102 self.assertEqual(results.actual_results("fast/dom/prototype-banana.html"
), "PASS") |
| 107 self.assertEqual(results.actual_results("fast/dom/prototype-taco.html"),
"PASS TEXT") | 103 self.assertEqual(results.actual_results("fast/dom/prototype-taco.html"),
"PASS TEXT") |
| 108 self.assertEqual(results.actual_results("nonexistant.html"), "") | 104 self.assertEqual(results.actual_results("nonexistant.html"), "") |
| OLD | NEW |