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

Side by Side Diff: tools/perf/metrics/speedindex_unittest.py

Issue 1029263003: [telemetry] Sort imports in Telemetry and its dependents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure we're up to date. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « tools/perf/metrics/speedindex.py ('k') | tools/perf/metrics/startup_metric.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 # These tests access private methods in the speedindex module. 5 # These tests access private methods in the speedindex module.
6 # pylint: disable=W0212 6 # pylint: disable=W0212
7 7
8 import json 8 import json
9 import os 9 import os
10 import unittest 10 import unittest
11 11
12 from metrics import speedindex
13 from telemetry.image_processing import histogram 12 from telemetry.image_processing import histogram
14 from telemetry.image_processing import rgba_color 13 from telemetry.image_processing import rgba_color
15 14
15 from metrics import speedindex
16
16 17
17 class FakeImageUtil(object): 18 class FakeImageUtil(object):
18 # pylint: disable=W0613 19 # pylint: disable=W0613
19 def GetColorHistogram(self, image, ignore_color=None, tolerance=None): 20 def GetColorHistogram(self, image, ignore_color=None, tolerance=None):
20 return image.ColorHistogram() 21 return image.ColorHistogram()
21 22
22 23
23 class FakeVideo(object): 24 class FakeVideo(object):
24 def __init__(self, frames): 25 def __init__(self, frames):
25 self._frames = frames 26 self._frames = frames
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 self.assertEqual(time_completeness[2], (0.2, 0.0)) 113 self.assertEqual(time_completeness[2], (0.2, 0.0))
113 self.assertEqual(time_completeness[3], (0.3, 1.0)) 114 self.assertEqual(time_completeness[3], (0.3, 1.0))
114 115
115 def assertTimeCompleteness(self, time_completeness, time, completeness): 116 def assertTimeCompleteness(self, time_completeness, time, completeness):
116 self.assertEqual(time_completeness[0], time) 117 self.assertEqual(time_completeness[0], time)
117 self.assertAlmostEqual(time_completeness[1], completeness) 118 self.assertAlmostEqual(time_completeness[1], completeness)
118 119
119 120
120 if __name__ == "__main__": 121 if __name__ == "__main__":
121 unittest.main() 122 unittest.main()
OLDNEW
« no previous file with comments | « tools/perf/metrics/speedindex.py ('k') | tools/perf/metrics/startup_metric.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698