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

Unified Diff: tools/telemetry/telemetry/benchmark.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/perf/benchmarks/benchmark_unittest.py ('k') | tools/telemetry/telemetry/page/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/benchmark.py
diff --git a/tools/telemetry/telemetry/benchmark.py b/tools/telemetry/telemetry/benchmark.py
index ec2c87534a526b12cf688d097cb2a1ffa1ce988f..88386cde413ce67262853b228b4f13bd16abe5df 100644
--- a/tools/telemetry/telemetry/benchmark.py
+++ b/tools/telemetry/telemetry/benchmark.py
@@ -84,15 +84,15 @@ class Benchmark(command_line.Command):
if hasattr(self, '_enabled_strings'):
pt._enabled_strings = self._enabled_strings
- ps = self.CreatePageSet(finder_options)
expectations = self.CreateExpectations()
+ us = self.CreateUserStorySet(finder_options)
self._DownloadGeneratedProfileArchive(finder_options)
benchmark_metadata = self.GetMetadata()
results = results_options.CreateResults(benchmark_metadata, finder_options)
try:
- page_runner.Run(pt, ps, expectations, finder_options, results)
+ page_runner.Run(pt, us, expectations, finder_options, results)
except page_test.TestNotSupportedOnPlatformFailure as failure:
logging.warning(str(failure))
@@ -174,29 +174,23 @@ class Benchmark(command_line.Command):
raise TypeError('"%s" is not a PageTest.' % cls.test.__name__)
return cls.test
- @classmethod
- def PageSetClass(cls):
- """Get the PageSet for this Benchmark.
+ def CreatePageSet(self, options): # pylint: disable=W0613
+ """Get the page set this test will run on.
- If the Benchmark has no PageSet, raises NotImplementedError.
+ By default, it will create a page set from the this test's page_set
+ attribute. Override to generate a custom page set.
"""
- if not hasattr(cls, 'page_set'):
+ if not hasattr(self, 'page_set'):
raise NotImplementedError('This test has no "page_set" attribute.')
- if not issubclass(cls.page_set, page_set.PageSet):
- raise TypeError('"%s" is not a PageSet.' % cls.page_set.__name__)
- return cls.page_set
-
- @classmethod
- def CreatePageSet(cls, options): # pylint: disable=W0613
- """Get the page set this test will run on.
+ if not issubclass(self.page_set, page_set.PageSet):
+ raise TypeError('"%s" is not a PageSet.' % self.page_set.__name__)
+ return self.page_set()
- By default, it will create a page set from the file at this test's
- page_set attribute. Override to generate a custom page set.
- """
- return cls.PageSetClass()()
+ def CreateUserStorySet(self, options):
+ return self.CreatePageSet(options)
@classmethod
- def CreateExpectations(cls): # pylint: disable=W0613
+ def CreateExpectations(cls):
"""Get the expectations this test will run with.
By default, it will create an empty expectations set. Override to generate
« no previous file with comments | « tools/perf/benchmarks/benchmark_unittest.py ('k') | tools/telemetry/telemetry/page/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698