| 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 logging | 5 import logging |
| 6 import optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 import time | 9 import time |
| 10 | 10 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 benchmark_metadata = benchmark.GetMetadata() | 272 benchmark_metadata = benchmark.GetMetadata() |
| 273 possible_browser = browser_finder.FindBrowser(finder_options) | 273 possible_browser = browser_finder.FindBrowser(finder_options) |
| 274 expectations = benchmark.InitializeExpectations() | 274 expectations = benchmark.InitializeExpectations() |
| 275 | 275 |
| 276 if not possible_browser: | 276 if not possible_browser: |
| 277 print ('Cannot find browser of type %s. To list out all ' | 277 print ('Cannot find browser of type %s. To list out all ' |
| 278 'available browsers, rerun your command with ' | 278 'available browsers, rerun your command with ' |
| 279 '--browser=list' % finder_options.browser_options.browser_type) | 279 '--browser=list' % finder_options.browser_options.browser_type) |
| 280 return 1 | 280 return 1 |
| 281 | 281 |
| 282 can_run_on_platform = benchmark._CanRunOnPlatform(possible_browser.platform, |
| 283 finder_options) |
| 284 |
| 285 # TODO(rnephew): Remove decorators.IsBenchmarkEnabled and IsBenchmarkDisabled |
| 286 # when we have fully moved to _CanRunOnPlatform(). |
| 282 permanently_disabled = expectations.IsBenchmarkDisabled( | 287 permanently_disabled = expectations.IsBenchmarkDisabled( |
| 283 possible_browser.platform, finder_options) | 288 possible_browser.platform, finder_options) |
| 284 # TODO(rnephew): Remove decorators.IsBenchmarkEnabled when deprecated. | |
| 285 temporarily_disabled = not decorators.IsBenchmarkEnabled( | 289 temporarily_disabled = not decorators.IsBenchmarkEnabled( |
| 286 benchmark, possible_browser) | 290 benchmark, possible_browser) |
| 287 | 291 |
| 288 if permanently_disabled or temporarily_disabled: | 292 if permanently_disabled or temporarily_disabled or not can_run_on_platform: |
| 289 print '%s is disabled on the selected browser' % benchmark.Name() | 293 print '%s is disabled on the selected browser' % benchmark.Name() |
| 290 if finder_options.run_disabled_tests and not permanently_disabled: | 294 if finder_options.run_disabled_tests and not permanently_disabled: |
| 291 print 'Running benchmark anyway due to: --also-run-disabled-tests' | 295 print 'Running benchmark anyway due to: --also-run-disabled-tests' |
| 292 else: | 296 else: |
| 293 print 'Try --also-run-disabled-tests to force the benchmark to run.' | 297 print 'Try --also-run-disabled-tests to force the benchmark to run.' |
| 294 # If chartjson is specified, this will print a dict indicating the | 298 # If chartjson is specified, this will print a dict indicating the |
| 295 # benchmark name and disabled state. | 299 # benchmark name and disabled state. |
| 296 with results_options.CreateResults( | 300 with results_options.CreateResults( |
| 297 benchmark_metadata, finder_options, | 301 benchmark_metadata, finder_options, |
| 298 benchmark.ValueCanBeAddedPredicate, benchmark_enabled=False | 302 benchmark.ValueCanBeAddedPredicate, benchmark_enabled=False |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 reserved_infos.OS_VERSIONS.name: state.platform.GetOSVersionName(), | 462 reserved_infos.OS_VERSIONS.name: state.platform.GetOSVersionName(), |
| 459 } | 463 } |
| 460 | 464 |
| 461 device_info_diangostics = {} | 465 device_info_diangostics = {} |
| 462 | 466 |
| 463 for name, value in device_info_data.iteritems(): | 467 for name, value in device_info_data.iteritems(): |
| 464 if not value: | 468 if not value: |
| 465 continue | 469 continue |
| 466 device_info_diangostics[name] = histogram.GenericSet([value]) | 470 device_info_diangostics[name] = histogram.GenericSet([value]) |
| 467 return device_info_diangostics | 471 return device_info_diangostics |
| OLD | NEW |