Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: build/android/pylib/perf/surface_stats_collector_unittest.py

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix appurify_sanitized import-errors Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/perf/surface_stats_collector.py ('k') | build/android/pylib/perf/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/perf/surface_stats_collector_unittest.py
diff --git a/build/android/pylib/perf/surface_stats_collector_unittest.py b/build/android/pylib/perf/surface_stats_collector_unittest.py
deleted file mode 100644
index e905d7314e33383f6c7e6e1fe3d81aa5e6be7d23..0000000000000000000000000000000000000000
--- a/build/android/pylib/perf/surface_stats_collector_unittest.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Unittests for SurfaceStatsCollector."""
-# pylint: disable=W0212
-
-import unittest
-
-from pylib.perf.surface_stats_collector import SurfaceStatsCollector
-
-
-class TestSurfaceStatsCollector(unittest.TestCase):
- @staticmethod
- def _CreateUniformTimestamps(base, num, delta):
- return [base + i * delta for i in range(1, num + 1)]
-
- @staticmethod
- def _CreateDictionaryFromResults(results):
- dictionary = {}
- for result in results:
- dictionary[result.name] = result
- return dictionary
-
- def setUp(self):
- self.refresh_period = 0.1
-
- def testOneFrameDelta(self):
- timestamps = self._CreateUniformTimestamps(0, 10, self.refresh_period)
- results = self._CreateDictionaryFromResults(
- SurfaceStatsCollector._CalculateResults(
- self.refresh_period, timestamps, ''))
-
- self.assertEquals(results['avg_surface_fps'].value,
- int(round(1 / self.refresh_period)))
- self.assertEquals(results['jank_count'].value, 0)
- self.assertEquals(results['max_frame_delay'].value, 1)
- self.assertEquals(len(results['frame_lengths'].value), len(timestamps) - 1)
-
- def testAllFramesTooShort(self):
- timestamps = self._CreateUniformTimestamps(0, 10, self.refresh_period / 100)
- self.assertRaises(Exception,
- SurfaceStatsCollector._CalculateResults,
- [self.refresh_period, timestamps, ''])
-
- def testSomeFramesTooShort(self):
- timestamps = self._CreateUniformTimestamps(0, 5, self.refresh_period)
- # The following timestamps should be skipped.
- timestamps += self._CreateUniformTimestamps(timestamps[4],
- 5,
- self.refresh_period / 100)
- timestamps += self._CreateUniformTimestamps(timestamps[4],
- 5,
- self.refresh_period)
-
- results = self._CreateDictionaryFromResults(
- SurfaceStatsCollector._CalculateResults(
- self.refresh_period, timestamps, ''))
-
- self.assertEquals(len(results['frame_lengths'].value), 9)
-
-
-if __name__ == '__main__':
- unittest.main()
« no previous file with comments | « build/android/pylib/perf/surface_stats_collector.py ('k') | build/android/pylib/perf/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698