| 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 17 matching lines...) Expand all Loading... |
| 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 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.output_capture 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 |
| 46 | 46 |
| 47 class MainTest(unittest.TestCase): | 47 class MainTest(unittest.TestCase): |
| 48 | 48 |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 self._test_run_with_json_output(runner, port.host.filesystem, compare_lo
gs=False) | 795 self._test_run_with_json_output(runner, port.host.filesystem, compare_lo
gs=False) |
| 796 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) | 796 generated_json = json.loads(port.host.filesystem.files['/mock-checkout/o
utput.json']) |
| 797 self.assertTrue(isinstance(generated_json, list)) | 797 self.assertTrue(isinstance(generated_json, list)) |
| 798 self.assertEqual(len(generated_json), 1) | 798 self.assertEqual(len(generated_json), 1) |
| 799 | 799 |
| 800 output = generated_json[0]['tests']['Bindings']['tests']['event-target-w
rapper']['metrics']['Time']['current'] | 800 output = generated_json[0]['tests']['Bindings']['tests']['event-target-w
rapper']['metrics']['Time']['current'] |
| 801 self.assertEqual(len(output), 3) | 801 self.assertEqual(len(output), 3) |
| 802 expectedMetrics = EventTargetWrapperTestData.results['metrics']['Time'][
'current'][0] | 802 expectedMetrics = EventTargetWrapperTestData.results['metrics']['Time'][
'current'][0] |
| 803 for metrics in output: | 803 for metrics in output: |
| 804 self.assertEqual(metrics, expectedMetrics) | 804 self.assertEqual(metrics, expectedMetrics) |
| OLD | NEW |