[Android WebViewShell] Add inclusion test for webview exposed stable interfaces.
[chromium-blink-merge.git] / tools / perf / benchmarks / text_selection.py
blob3bf4bd063483f9231626496bd11c772f61431e90
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
3 # found in the LICENSE file.
5 from core import perf_benchmark
7 from telemetry import benchmark
8 from telemetry.timeline import tracing_category_filter
9 from telemetry.web_perf import timeline_based_measurement
11 import page_sets
13 TEXT_SELECTION_CATEGORY = 'blink'
14 TIMELINE_REQUIRED_CATEGORY = 'blink.console'
17 class _TextSelection(perf_benchmark.PerfBenchmark):
18 page_set = page_sets.TextSelectionSitesPageSet
20 def CreateTimelineBasedMeasurementOptions(self):
21 cat_filter = tracing_category_filter.CreateMinimalOverheadFilter()
22 cat_filter.AddIncludedCategory(TEXT_SELECTION_CATEGORY)
23 cat_filter.AddIncludedCategory(TIMELINE_REQUIRED_CATEGORY)
25 return timeline_based_measurement.Options(
26 overhead_level=cat_filter)
28 @classmethod
29 def Name(cls):
30 return 'text_selection'
32 @classmethod
33 def ValueCanBeAddedPredicate(cls, value, is_first_result):
34 if 'text-selection' not in value.name:
35 return False
36 return value.values != None
39 @benchmark.Enabled('android')
40 class TextSelectionDirection(_TextSelection):
41 """Measure text selection metrics while dragging a touch selection handle on a
42 subset of top ten mobile sites and using the 'direction' touch selection
43 strategy."""
44 def SetExtraBrowserOptions(self, options):
45 options.AppendExtraBrowserArgs(['--touch-selection-strategy=direction'])
47 @classmethod
48 def Name(cls):
49 return 'text_selection.direction'
52 @benchmark.Enabled('android')
53 class TextSelectionCharacter(_TextSelection):
54 """Measure text selection metrics while dragging a touch selection handle on a
55 subset of top ten mobile sites and using the 'character' touch selection
56 strategy."""
57 def SetExtraBrowserOptions(self, options):
58 options.AppendExtraBrowserArgs(['--touch-selection-strategy=character'])
60 @classmethod
61 def Name(cls):
62 return 'text_selection.character'