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

Unified Diff: telemetry/telemetry/benchmark_unittest.py

Issue 3001873002: [Telemetry] Add CanRunOnPlatform to story_runner and benchmark class. (Closed)
Patch Set: unit tests 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_unittest.py
diff --git a/telemetry/telemetry/benchmark_unittest.py b/telemetry/telemetry/benchmark_unittest.py
index c1238e671ddb84c8a5d5bba62a4805eb57a87b92..474e47400f27ceca9309942b32bf410a26ef5401 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))

Powered by Google App Engine
This is Rietveld 408576698