Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 os | 5 import os |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 from telemetry import benchmark | 8 from telemetry import benchmark |
| 9 from telemetry.internal.browser import browser_finder | 9 from telemetry.internal.browser import browser_finder |
| 10 | 10 |
| 11 sys.path.append(os.path.join(os.path.dirname(__file__), '..', | 11 sys.path.append(os.path.join(os.path.dirname(__file__), '..', |
| 12 '..', 'variations')) | 12 '..', 'variations')) |
| 13 import fieldtrial_util # pylint: disable=import-error | 13 import fieldtrial_util # pylint: disable=import-error |
| 14 | 14 |
| 15 | 15 |
| 16 class PerfBenchmark(benchmark.Benchmark): | 16 class PerfBenchmark(benchmark.Benchmark): |
| 17 """ Super class for all benchmarks in src/tools/perf/benchmarks directory. | 17 """ Super class for all benchmarks in src/tools/perf/benchmarks directory. |
| 18 All the perf benchmarks must subclass from this one to to make sure that | 18 All the perf benchmarks must subclass from this one to to make sure that |
| 19 the field trial configs are activated for the browser during benchmark runs. | 19 the field trial configs are activated for the browser during benchmark runs. |
| 20 For more info, see: https://goo.gl/4uvaVM | 20 For more info, see: https://goo.gl/4uvaVM |
| 21 """ | 21 """ |
| 22 | 22 |
| 23 def SetExtraBrowserOptions(self, options): | 23 def SetExtraBrowserOptions(self, options): |
| 24 """ To be overridden by perf benchmarks. """ | 24 """ To be overridden by perf benchmarks. """ |
| 25 pass | 25 pass |
| 26 | 26 |
| 27 def GetExtraIterationInfo(self): | |
| 28 info = {} | |
| 29 | |
| 30 botName = os.environ.get('BUILDBOT_BUILDERNAME') | |
| 31 if botName: | |
| 32 info['botName'] = botName | |
|
sullivan
2016/06/10 16:56:57
Do we need the bot name? The dashboard automatical
| |
| 33 | |
| 34 buildNumber = os.environ.get('BUILDBOT_BUILDNUMBER') | |
| 35 if buildNumber: | |
| 36 info['buildNumber'] = buildNumber | |
| 37 | |
| 38 revision = os.environ.get('BUILDBOT_REVISION') | |
| 39 if revision: | |
| 40 info['revision'] = revision | |
| 41 | |
|
sullivan
2016/06/10 16:56:57
These are pulled in via the recipe already.
| |
| 42 return info | |
| 43 | |
| 27 def CustomizeBrowserOptions(self, options): | 44 def CustomizeBrowserOptions(self, options): |
| 28 # Subclass of PerfBenchmark should override SetExtraBrowserOptions to add | 45 # Subclass of PerfBenchmark should override SetExtraBrowserOptions to add |
| 29 # more browser options rather than overriding CustomizeBrowserOptions. | 46 # more browser options rather than overriding CustomizeBrowserOptions. |
| 30 super(PerfBenchmark, self).CustomizeBrowserOptions(options) | 47 super(PerfBenchmark, self).CustomizeBrowserOptions(options) |
| 31 | 48 |
| 32 # Enable taking screen shot on failed pages for all perf benchmarks. | 49 # Enable taking screen shot on failed pages for all perf benchmarks. |
| 33 options.take_screenshot_for_failed_page = True | 50 options.take_screenshot_for_failed_page = True |
| 34 | 51 |
| 35 # The current field trial config is used for an older build in the case of | 52 # The current field trial config is used for an older build in the case of |
| 36 # reference. This is a problem because we are then subjecting older builds | 53 # reference. This is a problem because we are then subjecting older builds |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 62 os.path.join(variations_dir, | 79 os.path.join(variations_dir, |
| 63 'fieldtrial_testing_config_%s.json' % self._FixupTargetOS( | 80 'fieldtrial_testing_config_%s.json' % self._FixupTargetOS( |
| 64 possible_browser.target_os))) | 81 possible_browser.target_os))) |
| 65 | 82 |
| 66 @staticmethod | 83 @staticmethod |
| 67 def IsSvelte(possible_browser): | 84 def IsSvelte(possible_browser): |
| 68 """Returns whether a possible_browser is on a svelte Android build.""" | 85 """Returns whether a possible_browser is on a svelte Android build.""" |
| 69 if possible_browser.target_os == 'android': | 86 if possible_browser.target_os == 'android': |
| 70 return possible_browser.platform.IsSvelte() | 87 return possible_browser.platform.IsSvelte() |
| 71 return False | 88 return False |
| OLD | NEW |