| OLD | NEW |
| 1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 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 14 matching lines...) Expand all Loading... |
| 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 """Unit tests for run_perf_tests.""" | 29 """Unit tests for run_perf_tests.""" |
| 30 | 30 |
| 31 import StringIO | 31 import StringIO |
| 32 import datetime | 32 import datetime |
| 33 import json | 33 import json |
| 34 import re | 34 import re |
| 35 import unittest2 as unittest | 35 import unittest |
| 36 | 36 |
| 37 from webkitpy.common.host_mock import MockHost | 37 from webkitpy.common.host_mock import MockHost |
| 38 from webkitpy.common.system.outputcapture import OutputCapture | 38 from webkitpy.common.system.outputcapture import OutputCapture |
| 39 from webkitpy.layout_tests.port.driver import DriverOutput | 39 from webkitpy.layout_tests.port.driver import DriverOutput |
| 40 from webkitpy.layout_tests.port.test import TestPort | 40 from webkitpy.layout_tests.port.test import TestPort |
| 41 from webkitpy.performance_tests.perftest import ChromiumStylePerfTest | 41 from webkitpy.performance_tests.perftest import ChromiumStylePerfTest |
| 42 from webkitpy.performance_tests.perftest import DEFAULT_TEST_RUNNER_COUNT | 42 from webkitpy.performance_tests.perftest import DEFAULT_TEST_RUNNER_COUNT |
| 43 from webkitpy.performance_tests.perftest import PerfTest | 43 from webkitpy.performance_tests.perftest import PerfTest |
| 44 from webkitpy.performance_tests.perftestsrunner import PerfTestsRunner | 44 from webkitpy.performance_tests.perftestsrunner import PerfTestsRunner |
| 45 | 45 |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 self._test_run_with_json_output(runner, port.host.filesystem, compare_lo
gs=False) | 754 self._test_run_with_json_output(runner, port.host.filesystem, compare_lo
gs=False) |
| 755 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) | 755 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) |
| 756 self.assertTrue(isinstance(generated_json, list)) | 756 self.assertTrue(isinstance(generated_json, list)) |
| 757 self.assertEqual(len(generated_json), 1) | 757 self.assertEqual(len(generated_json), 1) |
| 758 | 758 |
| 759 output = generated_json[0]['tests']['Bindings']['tests']['event-target-w
rapper']['metrics']['Time']['current'] | 759 output = generated_json[0]['tests']['Bindings']['tests']['event-target-w
rapper']['metrics']['Time']['current'] |
| 760 self.assertEqual(len(output), 3) | 760 self.assertEqual(len(output), 3) |
| 761 expectedMetrics = EventTargetWrapperTestData.results['metrics']['Time'][
'current'][0] | 761 expectedMetrics = EventTargetWrapperTestData.results['metrics']['Time'][
'current'][0] |
| 762 for metrics in output: | 762 for metrics in output: |
| 763 self.assertEqual(metrics, expectedMetrics) | 763 self.assertEqual(metrics, expectedMetrics) |
| OLD | NEW |