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

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

Issue 637153002: telemetry: Remove command line args from page test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Suppress pylint E1003 Created 6 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
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 measurements import smoothness 6 from measurements import smoothness
7 from metrics import power 7 from metrics import power
8 from telemetry.core import exceptions 8 from telemetry.core import exceptions
9 from telemetry.core import wpr_modes 9 from telemetry.core import wpr_modes
10 from telemetry.page import page 10 from telemetry.page import page
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 'percentage_smooth') 142 'percentage_smooth')
143 self.assertEquals(len(percentage_smooth), 1) 143 self.assertEquals(len(percentage_smooth), 1)
144 self.assertGreaterEqual(percentage_smooth[0].GetRepresentativeNumber(), 0) 144 self.assertGreaterEqual(percentage_smooth[0].GetRepresentativeNumber(), 0)
145 145
146 def testCleanUpTrace(self): 146 def testCleanUpTrace(self):
147 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) 147 self.TestTracingCleanedUp(smoothness.Smoothness, self._options)
148 148
149 def testCleanUpPowerMetric(self): 149 def testCleanUpPowerMetric(self):
150 class FailPage(page.Page): 150 class FailPage(page.Page):
151 def __init__(self, page_set): 151 def __init__(self, page_set):
152 # pylint: disable=E1003
152 super(FailPage, self).__init__( 153 super(FailPage, self).__init__(
153 url='file://blank.html', 154 url='file://blank.html',
154 page_set=page_set, base_dir=page_set.base_dir) 155 page_set=page_set, base_dir=page_set.base_dir)
155 def RunSmoothness(self, _): 156 def RunSmoothness(self, _):
156 raise exceptions.IntentionalException 157 raise exceptions.IntentionalException
157 158
158 class FakePowerMetric(power.PowerMetric): 159 class FakePowerMetric(power.PowerMetric):
159 start_called = False 160 start_called = False
160 stop_called = True 161 stop_called = True
161 def Start(self, _1, _2): 162 def Start(self, _1, _2):
(...skipping 11 matching lines...) Expand all
173 self.fake_power = self._power_metric = FakePowerMetric(platform) 174 self.fake_power = self._power_metric = FakePowerMetric(platform)
174 175
175 measurement = BuggyMeasurement() 176 measurement = BuggyMeasurement()
176 try: 177 try:
177 self.RunMeasurement(measurement, ps) 178 self.RunMeasurement(measurement, ps)
178 except page_test.TestNotSupportedOnPlatformFailure: 179 except page_test.TestNotSupportedOnPlatformFailure:
179 pass 180 pass
180 181
181 self.assertTrue(measurement.fake_power.start_called) 182 self.assertTrue(measurement.fake_power.start_called)
182 self.assertTrue(measurement.fake_power.stop_called) 183 self.assertTrue(measurement.fake_power.stop_called)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698