OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import os | 5 import os |
6 | 6 |
7 from telemetry.page import page_test | 7 from telemetry.page import legacy_page_test |
8 from telemetry.timeline.model import TimelineModel | 8 from telemetry.timeline.model import TimelineModel |
9 from telemetry.timeline import tracing_config | 9 from telemetry.timeline import tracing_config |
10 from telemetry.value import list_of_scalar_values | 10 from telemetry.value import list_of_scalar_values |
11 from telemetry.value import scalar | 11 from telemetry.value import scalar |
12 | 12 |
13 | 13 |
14 _CR_RENDERER_MAIN = 'CrRendererMain' | 14 _CR_RENDERER_MAIN = 'CrRendererMain' |
15 _RUN_SMOOTH_ACTIONS = 'RunSmoothAllActions' | 15 _RUN_SMOOTH_ACTIONS = 'RunSmoothAllActions' |
16 | 16 |
17 | 17 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 total_sweep_time += sweep_time | 122 total_sweep_time += sweep_time |
123 results.AddValue( | 123 results.AddValue( |
124 scalar.ScalarValue(page, 'oilpan_sweep', unit, total_sweep_time)) | 124 scalar.ScalarValue(page, 'oilpan_sweep', unit, total_sweep_time)) |
125 | 125 |
126 gc_time = 0 | 126 gc_time = 0 |
127 for key in values: | 127 for key in values: |
128 gc_time += sum(values[key]) | 128 gc_time += sum(values[key]) |
129 results.AddValue(scalar.ScalarValue(page, 'oilpan_gc', unit, gc_time)) | 129 results.AddValue(scalar.ScalarValue(page, 'oilpan_gc', unit, gc_time)) |
130 | 130 |
131 | 131 |
132 class _OilpanGCTimesBase(page_test.PageTest): | 132 class _OilpanGCTimesBase(legacy_page_test.LegacyPageTest): |
133 | 133 |
134 def __init__(self, action_name=''): | 134 def __init__(self, action_name=''): |
135 super(_OilpanGCTimesBase, self).__init__(action_name) | 135 super(_OilpanGCTimesBase, self).__init__(action_name) |
136 | 136 |
137 def WillNavigateToPage(self, page, tab): | 137 def WillNavigateToPage(self, page, tab): |
138 # FIXME: Remove webkit.console when blink.console lands in chromium and | 138 # FIXME: Remove webkit.console when blink.console lands in chromium and |
139 # the ref builds are updated. crbug.com/386847 | 139 # the ref builds are updated. crbug.com/386847 |
140 config = tracing_config.TracingConfig() | 140 config = tracing_config.TracingConfig() |
141 for c in ['webkit.console', 'blink.console', 'blink_gc']: | 141 for c in ['webkit.console', 'blink.console', 'blink_gc']: |
142 config.tracing_category_filter.AddIncludedCategory(c) | 142 config.tracing_category_filter.AddIncludedCategory(c) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 def __init__(self): | 195 def __init__(self): |
196 super(OilpanGCTimesForInternals, self).__init__() | 196 super(OilpanGCTimesForInternals, self).__init__() |
197 | 197 |
198 @classmethod | 198 @classmethod |
199 def CustomizeBrowserOptions(cls, options): | 199 def CustomizeBrowserOptions(cls, options): |
200 # 'expose-internals-for-testing' can be enabled on content shell. | 200 # 'expose-internals-for-testing' can be enabled on content shell. |
201 assert 'content-shell' in options.browser_type | 201 assert 'content-shell' in options.browser_type |
202 options.AppendExtraBrowserArgs(['--expose-internals-for-testing', | 202 options.AppendExtraBrowserArgs(['--expose-internals-for-testing', |
203 '--js-flags=--expose-gc']) | 203 '--js-flags=--expose-gc']) |
OLD | NEW |