1# Copyright 2018 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.
4
5import collections
6
7
8Tag = collections.namedtuple('Tag', ['name', 'description'])
9
10
11# Below are tags that describe various aspect of rendering stories.
12# A story can have multiple tags. All the tags should be nouns.
13
14GPU_RASTERIZATION = Tag(
15    'gpu_rasterization', 'Story tests performance with GPU rasterization.')
16FASTPATH = Tag(
17    'fastpath', 'Fast path stories.')
18REQUIRED_WEBGL = Tag(
19    'required_webgl', 'Stories that are skipped if no webgl support')
20USE_FAKE_CAMERA_DEVICE = Tag(
21    'use_fake_camera_device', 'Story requires a camera device for media')
22
23# Below are tags for filtering by page sets
24
25BACKDROP_FILTER = Tag(
26    'backdrop_filter', 'Backdrop filter stories')
27IMAGE_DECODING = Tag(
28    'image_decoding', ('Stories decoding JPEG and WebP (and using GPU '
29                       'rasterization) to compare YUV and RGB'))
30KEY_DESKTOP_MOVE = Tag(
31    'key_desktop_move', 'Key desktop move stories')
32KEY_HIT_TEST = Tag(
33    'key_hit_test', 'Key hit test stories')
34KEY_SILK = Tag(
35    'key_silk', 'Key silk stories')
36KEY_NOOP = Tag(
37    'key_noop', 'Key noop stories')
38KEY_IDLE_POWER = Tag(
39    'key_idle_power', 'Key idle power stories')
40MAPS = Tag(
41    'maps', 'Maps stories')
42MOTIONMARK = Tag(
43    'motionmark', 'Motionmark benchmark stories')
44PATHOLOGICAL_MOBILE_SITES = Tag(
45    'pathological_mobile_sites', 'Pathological mobile sites')
46POLYMER = Tag(
47    'polymer', 'Polymer stories')
48REPAINT_DESKTOP = Tag(
49    'repaint_desktop', 'Repaint desktop stories')
50# Representative story_tags are the cluster representatives of benchamrks
51# Documentation: https://goto.google.com/chrome-benchmark-clustering
52REPRESENTATIVE_MAC_DESKTOP = Tag(
53    'representative_mac_desktop', 'Rendering desktop representatives for mac')
54REPRESENTATIVE_MOBILE = Tag(
55    'representative_mobile', 'Rendering mobile representatives')
56REPRESENTATIVE_WIN_DESKTOP = Tag(
57    'representative_win_desktop',
58    'Rendering desktop representatives for windows')
59SIMPLE_CANVAS = Tag('simple_canvas', 'Simple canvas stories')
60SIMPLE_MOBILE_SITES = Tag(
61    'simple_mobile_sites', 'Simple mobile sites')
62THROUGHPUT_TEST = Tag(
63    'throughput_test', 'Test cases for throughput measurement')
64TOP_REAL_WORLD_DESKTOP = Tag(
65    'top_real_world_desktop', 'Top real world desktop stories')
66TOP_REAL_WORLD_MOBILE = Tag(
67    'top_real_world_mobile', 'Top real world mobile stories')
68TOUGH_ANIMATION = Tag(
69    'tough_animation', 'Tough animation stories')
70TOUGH_CANVAS = Tag(
71    'tough_canvas', 'Tough canvas stories')
72TOUGH_COMPOSITOR = Tag(
73    'tough_compositor', 'Tough compositor stories')
74TOUGH_FILTERS = Tag(
75    'tough_filters', 'Tough filters stories')
76TOUGH_IMAGE_DECODE = Tag(
77    'tough_image_decode', 'Tough image decode stories')
78TOUGH_PATH_RENDERING = Tag(
79    'tough_path_rendering', 'Tough path rendering stories')
80TOUGH_PINCH_ZOOM = Tag(
81    'tough_pinch_zoom', 'Tough pinch zoom stories (only on Mac for desktop)')
82TOUGH_PINCH_ZOOM_MOBILE = Tag(
83    'tough_pinch_zoom_mobile', 'Tough pinch zoom mobile stories')
84TOUGH_SCHEDULING = Tag(
85    'tough_scheduling', 'Tough scheduling stories')
86TOUGH_SCROLLING = Tag(
87    'tough_scrolling', 'Tough scrolling stories')
88TOUGH_TEXTURE_UPLOAD = Tag(
89    'tough_texture_upload', 'Tough texture upload stories')
90TOUGH_WEBGL = Tag(
91    'tough_webgl', 'Tough webgl stories')
92
93
94def _ExtractAllTags():
95  all_tag_names = set()
96  all_tags = []
97  # Collect all the tags defined in this module. Also assert that there is no
98  # duplicate tag names.
99  for obj in globals().values():
100    if isinstance(obj, Tag):
101      all_tags.append(obj)
102      assert obj.name not in all_tag_names, 'Duplicate tag name: %s' % obj.name
103      all_tag_names.add(obj.name)
104  return all_tags
105
106
107ALL_TAGS = _ExtractAllTags()
108