OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Unittests for SurfaceStatsCollector.""" | 5 """Unittests for SurfaceStatsCollector.""" |
| 6 # pylint: disable=W0212 |
6 | 7 |
7 import unittest | 8 import unittest |
8 | 9 |
9 from surface_stats_collector import SurfaceStatsCollector | 10 from pylib.perf.surface_stats_collector import SurfaceStatsCollector |
| 11 |
10 | 12 |
11 class TestSurfaceStatsCollector(unittest.TestCase): | 13 class TestSurfaceStatsCollector(unittest.TestCase): |
12 @staticmethod | 14 @staticmethod |
13 def _CreateUniformTimestamps(base, num, delta): | 15 def _CreateUniformTimestamps(base, num, delta): |
14 return [base + i * delta for i in range(1, num + 1)] | 16 return [base + i * delta for i in range(1, num + 1)] |
15 | 17 |
16 @staticmethod | 18 @staticmethod |
17 def _CreateDictionaryFromResults(results): | 19 def _CreateDictionaryFromResults(results): |
18 dictionary = {} | 20 dictionary = {} |
19 for result in results: | 21 for result in results: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 55 |
54 results = self._CreateDictionaryFromResults( | 56 results = self._CreateDictionaryFromResults( |
55 SurfaceStatsCollector._CalculateResults( | 57 SurfaceStatsCollector._CalculateResults( |
56 self.refresh_period, timestamps, '')) | 58 self.refresh_period, timestamps, '')) |
57 | 59 |
58 self.assertEquals(len(results['frame_lengths'].value), 9) | 60 self.assertEquals(len(results['frame_lengths'].value), 9) |
59 | 61 |
60 | 62 |
61 if __name__ == '__main__': | 63 if __name__ == '__main__': |
62 unittest.main() | 64 unittest.main() |
OLD | NEW |