| OLD | NEW |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 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 collections | 5 import collections |
| 6 | 6 |
| 7 | 7 |
| 8 Tag = collections.namedtuple('Tag', ['name', 'description']) | 8 Tag = collections.namedtuple('Tag', ['name', 'description']) |
| 9 | 9 |
| 10 | 10 |
| 11 # Below are tags that describe various aspect of system health stories. | 11 # Below are tags that describe various aspect of system health stories. |
| 12 # A story can have multiple tags. All the tags should be noun. | 12 # A story can have multiple tags. All the tags should be noun. |
| 13 | 13 |
| 14 AUDIO_PLAYBACK = Tag( | 14 AUDIO_PLAYBACK = Tag( |
| 15 'audio-playback', 'Story has audio playing.') | 15 'audio-playback', 'Story has audio playing.') |
| 16 CANVAS_ANIMATION = Tag( | 16 CANVAS_ANIMATION = Tag( |
| 17 'canvas-animation', 'Story has animations that are implemented using ' | 17 'canvas-animation', 'Story has animations that are implemented using ' |
| 18 'html5 canvas.') | 18 'html5 canvas.') |
| 19 CSS_ANIMATION = Tag( | 19 CSS_ANIMATION = Tag( |
| 20 'css-animation', 'Story has animations that are implemented using CSS.') | 20 'css-animation', 'Story has animations that are implemented using CSS.') |
| 21 EXTENSION = Tag( | 21 EXTENSION = Tag( |
| 22 'extension', 'Story has browser with extension installed.') | 22 'extension', 'Story has browser with extension installed.') |
| 23 IMAGES = Tag( | 23 IMAGES = Tag( |
| 24 'images', 'Story has sites with heavy uses of images.') | 24 'images', 'Story has sites with heavy uses of images.') |
| 25 INTERNATIONAL = Tag( | 25 INTERNATIONAL = Tag( |
| 26 'international', 'Story has navigations to websites with content in non ' | 26 'international', 'Story has navigations to websites with content in non ' |
| 27 'English languages.') | 27 'English languages.') |
| 28 EMERGING_MARKET = Tag( |
| 29 'emerging-market', 'Story has significant usage in emerging markets with ' |
| 30 'low-end mobile devices and slow network connections.') |
| 28 JAVASCRIPT_HEAVY = Tag( | 31 JAVASCRIPT_HEAVY = Tag( |
| 29 'javascript-heavy', 'Story has navigations to websites with heavy usages ' | 32 'javascript-heavy', 'Story has navigations to websites with heavy usages ' |
| 30 'of JavaScript. The story uses 20Mb+ memory for javascript and local ' | 33 'of JavaScript. The story uses 20Mb+ memory for javascript and local ' |
| 31 'run with "v8" category enabled also shows the trace has js slices across ' | 34 'run with "v8" category enabled also shows the trace has js slices across ' |
| 32 'the whole run.') | 35 'the whole run.') |
| 33 SCROLL = Tag( | 36 SCROLL = Tag( |
| 34 'scroll', 'Story has scroll gestures & scroll animation.') | 37 'scroll', 'Story has scroll gestures & scroll animation.') |
| 35 PINCH_ZOOM = Tag( | 38 PINCH_ZOOM = Tag( |
| 36 'pinch-zoom', 'Story has pinch zoom gestures & pinch zoom animation.') | 39 'pinch-zoom', 'Story has pinch zoom gestures & pinch zoom animation.') |
| 37 TABS_SWITCHING = Tag( | 40 TABS_SWITCHING = Tag( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 51 # duplicate tag names. | 54 # duplicate tag names. |
| 52 for obj in globals().values(): | 55 for obj in globals().values(): |
| 53 if isinstance(obj, Tag): | 56 if isinstance(obj, Tag): |
| 54 all_tags.append(obj) | 57 all_tags.append(obj) |
| 55 assert obj.name not in all_tag_names, 'Duplicate tag name: %s' % obj.name | 58 assert obj.name not in all_tag_names, 'Duplicate tag name: %s' % obj.name |
| 56 all_tag_names.add(obj.name) | 59 all_tag_names.add(obj.name) |
| 57 return all_tags | 60 return all_tags |
| 58 | 61 |
| 59 | 62 |
| 60 ALL_TAGS = _ExtractAllTags() | 63 ALL_TAGS = _ExtractAllTags() |
| OLD | NEW |