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

Side by Side Diff: tools/perf/measurements/smoothness_unittest.py

Issue 1242943005: [Android] Support idle wakeup measurement with /proc/timer_stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Working test Created 5 years, 4 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
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 import sys 4 import sys
5 5
6 from telemetry import decorators 6 from telemetry import decorators
7 from telemetry.page import page 7 from telemetry.page import page
8 from telemetry.testing import options_for_unittests 8 from telemetry.testing import options_for_unittests
9 from telemetry.testing import page_test_test_case 9 from telemetry.testing import page_test_test_case
10 from telemetry.util import wpr_modes 10 from telemetry.util import wpr_modes
11 11
12 from measurements import smoothness 12 from measurements import smoothness
13 13
14 14
15 class FakeTracingController(object): 15 class FakeTracingController(object):
16 def __init__(self): 16 def __init__(self):
17 self.category_filter = None 17 self.category_filter = None
18 def Start(self, options, category_filter): 18 def Start(self, options, category_filter):
19 del options # unused 19 del options # unused
20 self.category_filter = category_filter 20 self.category_filter = category_filter
21 21
22 def IsChromeTracingSupported(self): 22 def IsChromeTracingSupported(self):
23 return True 23 return True
24 24
25 25
26 class FakePlatform(object): 26 class FakePlatform(object):
27 def __init__(self): 27 def __init__(self):
28 self.tracing_controller = FakeTracingController() 28 self.tracing_controller = FakeTracingController()
29 def CanMeasureIdleWakeUps(self):
nednguyen 2015/07/29 22:22:45 Why do you need to add this? IIRC, we removed powe
30 return False
29 31
30 32
31 class FakeBrowser(object): 33 class FakeBrowser(object):
32 def __init__(self): 34 def __init__(self):
33 self.platform = FakePlatform() 35 self.platform = FakePlatform()
34 36
35 37
36 class FakeTab(object): 38 class FakeTab(object):
37 def __init__(self): 39 def __init__(self):
38 self.browser = FakeBrowser() 40 self.browser = FakeBrowser()
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 max_frame_delay = results.FindAllPageSpecificValuesNamed('max_frame_delay') 132 max_frame_delay = results.FindAllPageSpecificValuesNamed('max_frame_delay')
131 self.assertEquals(1, len(max_frame_delay)) 133 self.assertEquals(1, len(max_frame_delay))
132 self.assertGreater(max_frame_delay[0].GetRepresentativeNumber, 0) 134 self.assertGreater(max_frame_delay[0].GetRepresentativeNumber, 0)
133 135
134 frame_lengths = results.FindAllPageSpecificValuesNamed('frame_lengths') 136 frame_lengths = results.FindAllPageSpecificValuesNamed('frame_lengths')
135 self.assertEquals(1, len(frame_lengths)) 137 self.assertEquals(1, len(frame_lengths))
136 self.assertGreater(frame_lengths[0].GetRepresentativeNumber, 0) 138 self.assertGreater(frame_lengths[0].GetRepresentativeNumber, 0)
137 139
138 def testCleanUpTrace(self): 140 def testCleanUpTrace(self):
139 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) 141 self.TestTracingCleanedUp(smoothness.Smoothness, self._options)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698