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

Unified Diff: tools/telemetry/telemetry/benchmark.py

Issue 1217653003: Revert of [Telemetry] Modify CreatePageSet to CreateStorySet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/telemetry/telemetry/benchmark.py
diff --git a/tools/telemetry/telemetry/benchmark.py b/tools/telemetry/telemetry/benchmark.py
index 0c94fc1ef004f68d64c1afb5cf71864ed229e2cf..7f3f1aefb0dc5ed6ac1420da3ca693b912cdfe32 100644
--- a/tools/telemetry/telemetry/benchmark.py
+++ b/tools/telemetry/telemetry/benchmark.py
@@ -11,6 +11,7 @@
from telemetry.internal import story_runner
from telemetry.internal.util import exception_formatter
from telemetry import page
+from telemetry.page import page_set
from telemetry.page import page_test
from telemetry.page import test_expectations
from telemetry.web_perf import timeline_based_measurement
@@ -241,17 +242,24 @@
self.SetupTraceRerunOptions(options, opts)
return timeline_based_measurement.TimelineBasedMeasurement(opts)
+ def CreatePageSet(self, options): # pylint: disable=unused-argument
+ """Get the page set this test will run on.
+
+ 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(self, 'page_set'):
+ raise NotImplementedError('This test has no "page_set" attribute.')
+ if not issubclass(self.page_set, page_set.PageSet):
+ raise TypeError('"%s" is not a PageSet.' % self.page_set.__name__)
+ return self.page_set()
+
def CreateStorySet(self, options):
"""Creates the instance of StorySet used to run the benchmark.
Can be overridden by subclasses.
"""
- del options # unused
- # TODO(aiolos, nednguyen, eakufner): replace class attribute page_set with
- # story_set.
- if not hasattr(self, 'page_set'):
- raise NotImplementedError('This test has no "page_set" attribute.')
- return self.page_set()
+ return self.CreatePageSet(options)
@classmethod
def CreateExpectations(cls):
« no previous file with comments | « tools/perf/measurements/thread_times_unittest.py ('k') | tools/telemetry/telemetry/internal/util/find_dependencies.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698