OLD | NEW |
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 telemetry.core import wpr_modes | 7 from telemetry.core import wpr_modes |
8 from telemetry.page import page | 8 from telemetry.page import page |
9 from telemetry.page import page_measurement_unittest_base | 9 from telemetry.page import page_measurement_unittest_base |
10 from telemetry.unittest import options_for_unittests | 10 from telemetry.unittest import options_for_unittests |
11 | 11 |
12 class FakePlatform(object): | 12 class FakePlatform(object): |
13 def IsRawDisplayFrameRateSupported(self): | 13 def IsRawDisplayFrameRateSupported(self): |
14 return False | 14 return False |
15 def CanMonitorPowerAsync(self): | 15 def CanMonitorPower(self): |
16 return False | 16 return False |
17 | 17 |
18 | 18 |
19 class FakeBrowser(object): | 19 class FakeBrowser(object): |
20 def __init__(self): | 20 def __init__(self): |
21 self.platform = FakePlatform() | 21 self.platform = FakePlatform() |
22 self.category_filter = None | 22 self.category_filter = None |
23 | 23 |
24 def StartTracing(self, category_filter, _): | 24 def StartTracing(self, category_filter, _): |
25 self.category_filter = category_filter | 25 self.category_filter = category_filter |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 mean_touch_scroll_latency = results.FindAllPageSpecificValuesNamed( | 104 mean_touch_scroll_latency = results.FindAllPageSpecificValuesNamed( |
105 'mean_touch_scroll_latency') | 105 'mean_touch_scroll_latency') |
106 if mean_touch_scroll_latency: | 106 if mean_touch_scroll_latency: |
107 self.assertEquals(len(mean_touch_scroll_latency), 1) | 107 self.assertEquals(len(mean_touch_scroll_latency), 1) |
108 self.assertGreater( | 108 self.assertGreater( |
109 mean_touch_scroll_latency[0].GetRepresentativeNumber(), 0) | 109 mean_touch_scroll_latency[0].GetRepresentativeNumber(), 0) |
110 | 110 |
111 def testCleanUpTrace(self): | 111 def testCleanUpTrace(self): |
112 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) | 112 self.TestTracingCleanedUp(smoothness.Smoothness, self._options) |
OLD | NEW |