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

Unified Diff: telemetry/telemetry/benchmark_unittest.py

Issue 3001873002: [Telemetry] Add CanRunOnPlatform to story_runner and benchmark class. (Closed)
Patch Set: Charlies comments 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
« no previous file with comments | « telemetry/telemetry/benchmark.py ('k') | telemetry/telemetry/internal/story_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/benchmark_unittest.py
diff --git a/telemetry/telemetry/benchmark_unittest.py b/telemetry/telemetry/benchmark_unittest.py
index c1238e671ddb84c8a5d5bba62a4805eb57a87b92..8605323916cae0a29b48540820fbf148a97558da 100644
--- a/telemetry/telemetry/benchmark_unittest.py
+++ b/telemetry/telemetry/benchmark_unittest.py
@@ -289,3 +289,20 @@ class BenchmarkTest(unittest.TestCase):
self.assertEqual(
['string', 'foo', 'stuff', 'bar'],
tbm._tbm_options.config.atrace_config.categories)
+
+ def testCanRunOnPlatformReturnTrue(self):
+ b = TestBenchmark(story_module.Story(
+ name='test name',
+ shared_state_class=shared_page_state.SharedPageState))
+ # We can pass None for both arguments because it defaults to ALL for
+ # supported platforms, which always returns true.
+ self.assertTrue(b._CanRunOnPlatform(None, None))
+
+ def testCanRunOnPlatformReturnFalse(self):
+ b = TestBenchmark(story_module.Story(
+ name='test name',
+ shared_state_class=shared_page_state.SharedPageState))
+ b.SUPPORTED_PLATFORMS = []
+ # We can pass None for both arguments because we select no platforms as
+ # supported, which always returns false.
+ self.assertFalse(b._CanRunOnPlatform(None, None))
« no previous file with comments | « telemetry/telemetry/benchmark.py ('k') | telemetry/telemetry/internal/story_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698