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

Unified Diff: telemetry/telemetry/benchmark.py

Issue 3001873002: [Telemetry] Add CanRunOnPlatform to story_runner and benchmark class. (Closed)
Patch Set: Make Method Private Created 3 years, 4 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: telemetry/telemetry/benchmark.py
diff --git a/telemetry/telemetry/benchmark.py b/telemetry/telemetry/benchmark.py
index 3cea7caa5cd21ff0108665eaf34c33414e432ff4..04dad73967b8b6427b78541a12971bbd5ee0b99c 100644
--- a/telemetry/telemetry/benchmark.py
+++ b/telemetry/telemetry/benchmark.py
@@ -63,6 +63,7 @@ class Benchmark(command_line.Command):
options = {}
page_set = None
test = timeline_based_measurement.TimelineBasedMeasurement
+ SUPPORTED_PLATFORMS = [expectations.ALL]
def __init__(self, max_failures=None):
"""Creates a new Benchmark.
@@ -82,6 +83,16 @@ class Benchmark(command_line.Command):
# See https://github.com/catapult-project/catapult/issues/3708
+ def _CanRunOnPlatform(self, platform, finder_options):
+ for p in self.SUPPORTED_PLATFORMS:
+ # This is reusing StoryExpectation code, so it is a bit unintuitive. We
+ # are trying to detect the opposite of the usual case in StoryExpectations
+ # so we want to return True when ShouldDisable returns true, even though
+ # we do not want to disable.
+ if p.ShouldDisable(platform, finder_options):
charliea (OOO until 10-5) 2017/08/22 17:22:18 I understand why this works the way that it does,
rnephew (Reviews Here) 2017/08/22 17:33:20 The expectations file has the TestCondition class
+ return True
+ return False
+
# pylint: disable=unused-argument
@classmethod
def ShouldDisable(cls, possible_browser):
« no previous file with comments | « no previous file | telemetry/telemetry/benchmark_unittest.py » ('j') | telemetry/telemetry/internal/story_runner.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698