OLD | NEW |
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 Loading... |
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)) |
OLD | NEW |