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

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

Issue 1458083003: [Telemetry + tools/perf] Modify the pylint disable message to use symbolic name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/system_memory.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=protected-access
7 7
8 import unittest 8 import unittest
9 9
10 from telemetry.util import color_histogram 10 from telemetry.util import color_histogram
11 from telemetry.util import rgba_color 11 from telemetry.util import rgba_color
12 12
13 from metrics import speedindex 13 from metrics import speedindex
14 14
15 15
16 class FakeImageUtil(object): 16 class FakeImageUtil(object):
17 # pylint: disable=W0613 17 # pylint: disable=unused-argument
18 def GetColorHistogram(self, image, ignore_color=None, tolerance=None): 18 def GetColorHistogram(self, image, ignore_color=None, tolerance=None):
19 return image.ColorHistogram() 19 return image.ColorHistogram()
20 20
21 21
22 class FakeVideo(object): 22 class FakeVideo(object):
23 def __init__(self, frames): 23 def __init__(self, frames):
24 self._frames = frames 24 self._frames = frames
25 25
26 def GetVideoFrameIter(self): 26 def GetVideoFrameIter(self):
27 for frame in self._frames: 27 for frame in self._frames:
28 yield frame 28 yield frame
29 29
30 class FakeBitmap(object): 30 class FakeBitmap(object):
31 def __init__(self, r, g, b): 31 def __init__(self, r, g, b):
32 self._histogram = color_histogram.ColorHistogram(r, g, b, rgba_color.WHITE) 32 self._histogram = color_histogram.ColorHistogram(r, g, b, rgba_color.WHITE)
33 33
34 # pylint: disable=W0613 34 # pylint: disable=unused-argument
35 def ColorHistogram(self, ignore_color=None, tolerance=None): 35 def ColorHistogram(self, ignore_color=None, tolerance=None):
36 return self._histogram 36 return self._histogram
37 37
38 38
39 class FakeTab(object): 39 class FakeTab(object):
40 def __init__(self, video_capture_result=None): 40 def __init__(self, video_capture_result=None):
41 self._javascript_result = None 41 self._javascript_result = None
42 self._video_capture_result = FakeVideo(video_capture_result) 42 self._video_capture_result = FakeVideo(video_capture_result)
43 43
44 @property 44 @property
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 self.assertEqual(time_completeness[2], (0.2, 0.0)) 111 self.assertEqual(time_completeness[2], (0.2, 0.0))
112 self.assertEqual(time_completeness[3], (0.3, 1.0)) 112 self.assertEqual(time_completeness[3], (0.3, 1.0))
113 113
114 def assertTimeCompleteness(self, time_completeness, time, completeness): 114 def assertTimeCompleteness(self, time_completeness, time, completeness):
115 self.assertEqual(time_completeness[0], time) 115 self.assertEqual(time_completeness[0], time)
116 self.assertAlmostEqual(time_completeness[1], completeness) 116 self.assertAlmostEqual(time_completeness[1], completeness)
117 117
118 118
119 if __name__ == "__main__": 119 if __name__ == "__main__":
120 unittest.main() 120 unittest.main()
OLDNEW
« no previous file with comments | « tools/perf/metrics/speedindex.py ('k') | tools/perf/metrics/system_memory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698