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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « telemetry/telemetry/benchmark.py ('k') | telemetry/telemetry/internal/story_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import optparse 5 import optparse
6 import unittest 6 import unittest
7 7
8 from telemetry import android 8 from telemetry import android
9 from telemetry import benchmark 9 from telemetry import benchmark
10 from telemetry.testing import options_for_unittests 10 from telemetry.testing import options_for_unittests
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 parser = optparse.OptionParser() 282 parser = optparse.OptionParser()
283 benchmark.AddCommandLineArgs(parser) 283 benchmark.AddCommandLineArgs(parser)
284 options.MergeDefaultValues(parser.get_default_values()) 284 options.MergeDefaultValues(parser.get_default_values())
285 285
286 b = TbmBenchmark(None) 286 b = TbmBenchmark(None)
287 tbm = b.CreatePageTest(options) 287 tbm = b.CreatePageTest(options)
288 self.assertTrue(tbm._tbm_options.config.enable_atrace_trace) 288 self.assertTrue(tbm._tbm_options.config.enable_atrace_trace)
289 self.assertEqual( 289 self.assertEqual(
290 ['string', 'foo', 'stuff', 'bar'], 290 ['string', 'foo', 'stuff', 'bar'],
291 tbm._tbm_options.config.atrace_config.categories) 291 tbm._tbm_options.config.atrace_config.categories)
292
293 def testCanRunOnPlatformReturnTrue(self):
294 b = TestBenchmark(story_module.Story(
295 name='test name',
296 shared_state_class=shared_page_state.SharedPageState))
297 # We can pass None for both arguments because it defaults to ALL for
298 # supported platforms, which always returns true.
299 self.assertTrue(b._CanRunOnPlatform(None, None))
300
301 def testCanRunOnPlatformReturnFalse(self):
302 b = TestBenchmark(story_module.Story(
303 name='test name',
304 shared_state_class=shared_page_state.SharedPageState))
305 b.SUPPORTED_PLATFORMS = []
306 # We can pass None for both arguments because we select no platforms as
307 # supported, which always returns false.
308 self.assertFalse(b._CanRunOnPlatform(None, None))
OLDNEW
« 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