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

Unified Diff: tools/telemetry/telemetry/page/__init__.py

Issue 612963002: Introduce UserStory & UserStorySet classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up staticmethods related to PageCreation Created 6 years, 3 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
« no previous file with comments | « tools/telemetry/telemetry/benchmark.py ('k') | tools/telemetry/telemetry/page/page_set.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/__init__.py
diff --git a/tools/telemetry/telemetry/page/__init__.py b/tools/telemetry/telemetry/page/__init__.py
index 51dbc57433cd37e0cc479a104d08f89ad48518ae..2435080a8460799d523cf35cc7ce8ecfade86dd5 100644
--- a/tools/telemetry/telemetry/page/__init__.py
+++ b/tools/telemetry/telemetry/page/__init__.py
@@ -3,14 +3,15 @@
# found in the LICENSE file.
import inspect
import os
-import re
import urlparse
-_next_page_id = 0
+from telemetry import user_story
-class Page(object):
+
+class Page(user_story.UserStory):
def __init__(self, url, page_set=None, base_dir=None, name=''):
+ super(Page, self).__init__(name)
self._url = url
self._page_set = page_set
# Default value of base_dir is the directory of the file that defines the
@@ -20,9 +21,6 @@ class Page(object):
self._base_dir = base_dir
self._name = name
- global _next_page_id
- self._id = _next_page_id
- _next_page_id += 1
# These attributes can be set dynamically by the page.
self.synthetic_delays = dict()
@@ -91,17 +89,9 @@ class Page(object):
return self._page_set
@property
- def name(self):
- return self._name
-
- @property
def url(self):
return self._url
- @property
- def id(self):
- return self._id
-
def GetSyntheticDelayCategories(self):
result = []
for delay, options in self.synthetic_delays.items():
@@ -170,12 +160,6 @@ class Page(object):
return os.path.dirname(file_path)
@property
- def file_safe_name(self):
- """A version of display_name that's safe to use as a filename."""
- # Just replace all special characters in the url with underscore.
- return re.sub('[^a-zA-Z0-9]', '_', self.display_name)
-
- @property
def display_name(self):
if self.name:
return self.name
« no previous file with comments | « tools/telemetry/telemetry/benchmark.py ('k') | tools/telemetry/telemetry/page/page_set.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698