Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: tools/perf/page_sets/system_health/system_health_tags.py

Issue 2651623005: [tools/perf] Create a list of tags for system_health_story (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/perf/page_sets/system_health/system_health_tags.py
diff --git a/tools/perf/page_sets/system_health/system_health_tags.py b/tools/perf/page_sets/system_health/system_health_tags.py
new file mode 100644
index 0000000000000000000000000000000000000000..00bdc16605338be5df5f9489b98023bb8c2609c6
--- /dev/null
+++ b/tools/perf/page_sets/system_health/system_health_tags.py
@@ -0,0 +1,68 @@
+# Copyright 2017 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
nednguyen 2017/01/24 17:59:01 Note that I have name this "system_health_tags" in
rnephew (Reviews Here) 2017/01/24 18:23:09 If this plans to go farther than system health ben
charliea (OOO until 10-5) 2017/01/24 23:00:05 My vote for the name is story_tags because: - s
nednguyen 2017/02/03 15:02:42 Done.
+
+import sys
+
+
+class TagInfo(object):
+ def __init__(self, tag, description):
+ self._tag = tag
+ self._description = description
+
+ @property
+ def tag(self):
+ return self._tag
+
+ @property
+ def description(self):
+ return self._description
+
+AUDIO_PLAYING = TagInfo(
+ 'audio-playing', 'Stories with this tag have audio playing')
perezju 2017/01/24 19:50:05 "Stories with this tag have .." an all description
charliea (OOO until 10-5) 2017/01/24 23:00:05 It seems like we should be consistent about what's
perezju 2017/01/25 00:06:45 +1 to all nouns, and document this fact on the fil
nednguyen 2017/02/03 15:02:42 Done.
+CANVAS_ANIMATION = TagInfo(
+ 'canvas-animation', 'stories with this tags have animations that are '
rnephew (Reviews Here) 2017/01/24 18:23:09 Nit:Inconsistent capitalization between tags.
nednguyen 2017/02/03 15:02:42 Done.
+ 'implemented using html5 canvas')
+CSS_ANIMATION = TagInfo(
+ 'css-animation', 'stories with this tags have animations that are '
+ 'implemented using CSS')
+EXTENSION = TagInfo(
+ 'pinch-zoom', 'stories with this tags have browser with extension '
+ 'installed')
+IMAGES = TagInfo(
+ 'web-storage', 'stories with this tags have sites with heavy uses of '
charliea (OOO until 10-5) 2017/01/24 23:00:05 wut? web-storage == images?
nednguyen 2017/02/03 15:02:42 Done.
+ 'images.')
+INTERNATIONAL = TagInfo(
+ 'multi-tabs', 'stories with this tags include navigating to websites '
charliea (OOO until 10-5) 2017/01/24 23:00:05 same
nednguyen 2017/02/03 15:02:42 Done.
+ 'in non English speaking countries.')
+SCROLL = TagInfo(
+ 'scroll', 'stories with this tags have scroll gestures & scroll '
+ 'animation')
+PINCH_ZOOM = TagInfo(
+ 'pinch-zoom', 'stories with this tags have pinch zoom gestures & pinch zoom'
+ ' animation')
+MULTI_TABS_SWITCHING = TagInfo(
+ 'multi-tabs', 'stories with this tags have multi tabs and tabs switching '
+ 'action')
+VIDEO_PLAYING = TagInfo(
+ 'video-playing', 'Stories with this tag have video playing')
+WEBGL = TagInfo(
+ 'webgl', 'stories with this tags have sites with heavy uses of WebGL.')
+WEB_STORAGE = TagInfo(
+ 'web-storage', 'stories with this tags have sites with heavy uses of Web '
+ 'storage.')
+
+
+def _ExtractAllTagInfos():
+ all_tags = set()
+ all_tags_info = []
+ for obj in dir(sys.modules[__name__]):
rnephew (Reviews Here) 2017/01/24 18:23:09 A comment on what this is actually doing would be
charliea (OOO until 10-5) 2017/01/24 23:00:05 +1
nednguyen 2017/02/03 15:02:42 Done.
+ if isinstance(obj, TagInfo):
+ all_tags_info.append(obj)
+ assert obj.tag not in all_tags, 'Duplicate tag: %s' % obj.tag
+ all_tags.add(obj.tag)
+ return all_tags_info
+
+
+ALL_TAG_INFOS = _ExtractAllTagInfos()
+ALL_TAGS = [t.tag for t in ALL_TAG_INFOS]

Powered by Google App Engine
This is Rietveld 408576698