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 from core import perf_benchmark | 5 from core import perf_benchmark |
6 | 6 |
7 from telemetry import benchmark | 7 from telemetry import benchmark |
8 from telemetry.timeline import chrome_trace_category_filter | 8 from telemetry.timeline import chrome_trace_category_filter |
9 from telemetry.web_perf import timeline_based_measurement | 9 from telemetry.web_perf import timeline_based_measurement |
10 | 10 |
11 import page_sets | 11 import page_sets |
12 | 12 |
13 TEXT_SELECTION_CATEGORY = 'blink' | 13 TEXT_SELECTION_CATEGORY = 'blink' |
14 TIMELINE_REQUIRED_CATEGORY = 'blink.console' | 14 TIMELINE_REQUIRED_CATEGORY = 'blink.console' |
15 | 15 |
16 | 16 |
17 class _TextSelection(perf_benchmark.PerfBenchmark): | 17 class _TextSelection(perf_benchmark.PerfBenchmark): |
18 page_set = page_sets.TextSelectionSitesPageSet | 18 page_set = page_sets.TextSelectionSitesPageSet |
19 | 19 |
20 def CreateTimelineBasedMeasurementOptions(self): | 20 def CreateTimelineBasedMeasurementOptions(self): |
21 cat_filter = chrome_trace_category_filter.CreateMinimalOverheadFilter() | 21 cat_filter = chrome_trace_category_filter.ChromeTraceCategoryFilter() |
22 cat_filter.AddIncludedCategory(TEXT_SELECTION_CATEGORY) | 22 cat_filter.AddIncludedCategory(TEXT_SELECTION_CATEGORY) |
23 cat_filter.AddIncludedCategory(TIMELINE_REQUIRED_CATEGORY) | 23 cat_filter.AddIncludedCategory(TIMELINE_REQUIRED_CATEGORY) |
24 | 24 |
25 return timeline_based_measurement.Options( | 25 return timeline_based_measurement.Options( |
26 overhead_level=cat_filter) | 26 overhead_level=cat_filter) |
27 | 27 |
28 @classmethod | 28 @classmethod |
29 def Name(cls): | 29 def Name(cls): |
30 return 'text_selection' | 30 return 'text_selection' |
31 | 31 |
(...skipping 25 matching lines...) Expand all Loading... |
57 """Measure text selection metrics while dragging a touch selection handle on a | 57 """Measure text selection metrics while dragging a touch selection handle on a |
58 subset of top ten mobile sites and using the 'character' touch selection | 58 subset of top ten mobile sites and using the 'character' touch selection |
59 strategy.""" | 59 strategy.""" |
60 | 60 |
61 def SetExtraBrowserOptions(self, options): | 61 def SetExtraBrowserOptions(self, options): |
62 options.AppendExtraBrowserArgs(['--touch-selection-strategy=character']) | 62 options.AppendExtraBrowserArgs(['--touch-selection-strategy=character']) |
63 | 63 |
64 @classmethod | 64 @classmethod |
65 def Name(cls): | 65 def Name(cls): |
66 return 'text_selection.character' | 66 return 'text_selection.character' |
OLD | NEW |