diff options
author | danduong <danduong@chromium.org> | 2015-05-22 08:50:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-22 15:50:57 +0000 |
commit | 6746811ba27c04a30d9d4fca06e55c9704405ac8 (patch) | |
tree | 991c407c6ef6d19426a512a1696412fb8ff58534 /tools/perf | |
parent | 44370a8d290845d35e63cd93bae336aa9c67f833 (diff) | |
download | chromium_src-6746811ba27c04a30d9d4fca06e55c9704405ac8.zip chromium_src-6746811ba27c04a30d9d4fca06e55c9704405ac8.tar.gz chromium_src-6746811ba27c04a30d9d4fca06e55c9704405ac8.tar.bz2 |
Add support for field trial testing on the perf bots.
This commit adds a config JSON file and parsing/command-line formatting utility that is used to force specific field trials for the purpose of integrated testing. There are also modificiations to the perfbot scripts to make use of this. Going forward after this commit, all perfbot tests will force the field trials configured in fieldtrial_testing_config_[mac|win|linux|ios|android|chromeos].json.
BUG=480095
Review URL: https://codereview.chromium.org/1121813005
Cr-Commit-Position: refs/heads/master@{#331113}
Diffstat (limited to 'tools/perf')
42 files changed, 288 insertions, 163 deletions
diff --git a/tools/perf/benchmarks/benchmark_unittest.py b/tools/perf/benchmarks/benchmark_unittest.py index 571585e..e42179e 100644 --- a/tools/perf/benchmarks/benchmark_unittest.py +++ b/tools/perf/benchmarks/benchmark_unittest.py @@ -8,6 +8,8 @@ from collections import defaultdict import os import unittest +from core import perf_benchmark + from telemetry import benchmark as benchmark_module from telemetry.core import browser_options from telemetry.core import discover @@ -46,6 +48,20 @@ class TestNoBenchmarkNamesDuplication(unittest.TestCase): 'Multiple benchmarks with the same name %s are ' 'found: %s' % (n, str(names_to_benchmarks[n]))) + +class TestNoOverrideCustomizeBrowserOptions(unittest.TestCase): + def runTest(self): + all_benchmarks = _GetAllPerfBenchmarks() + for benchmark in all_benchmarks: + self.assertEquals(True, issubclass(benchmark, + perf_benchmark.PerfBenchmark), + 'Benchmark %s needs to subclass from PerfBenchmark' + % benchmark.Name()) + self.assertEquals(benchmark.CustomizeBrowserOptions, + perf_benchmark.PerfBenchmark.CustomizeBrowserOptions, + 'Benchmark %s should not override CustomizeBrowserOptions' + % benchmark.Name()) + def _AddBenchmarkOptionsTests(suite): # Using |index_by_class_name=True| allows returning multiple benchmarks # from a module. @@ -60,6 +76,7 @@ def _AddBenchmarkOptionsTests(suite): _BenchmarkOptionsTestGenerator(benchmark)) suite.addTest(BenchmarkOptionsTest(benchmark.Name())) suite.addTest(TestNoBenchmarkNamesDuplication()) + suite.addTest(TestNoOverrideCustomizeBrowserOptions()) def load_tests(loader, standard_tests, pattern): diff --git a/tools/perf/benchmarks/blink_perf.py b/tools/perf/benchmarks/blink_perf.py index 169b284..8367f86 100644 --- a/tools/perf/benchmarks/blink_perf.py +++ b/tools/perf/benchmarks/blink_perf.py @@ -4,6 +4,8 @@ import os +from core import perf_benchmark + from telemetry import benchmark from telemetry.core import util from telemetry import page as page_module @@ -114,7 +116,7 @@ class _BlinkPerfFullFrameMeasurement(_BlinkPerfMeasurement): options.AppendExtraBrowserArgs(['--expose-internals-for-testing']) -class BlinkPerfAnimation(benchmark.Benchmark): +class BlinkPerfAnimation(perf_benchmark.PerfBenchmark): tag = 'animation' test = _BlinkPerfMeasurement @@ -127,7 +129,7 @@ class BlinkPerfAnimation(benchmark.Benchmark): return CreatePageSetFromPath(path, SKIPPED_FILE) -class BlinkPerfBindings(benchmark.Benchmark): +class BlinkPerfBindings(perf_benchmark.PerfBenchmark): tag = 'bindings' test = _BlinkPerfMeasurement @@ -141,7 +143,7 @@ class BlinkPerfBindings(benchmark.Benchmark): @benchmark.Enabled('content-shell') -class BlinkPerfBlinkGC(benchmark.Benchmark): +class BlinkPerfBlinkGC(perf_benchmark.PerfBenchmark): tag = 'blink_gc' test = _BlinkPerfMeasurement @@ -154,7 +156,7 @@ class BlinkPerfBlinkGC(benchmark.Benchmark): return CreatePageSetFromPath(path, SKIPPED_FILE) -class BlinkPerfCSS(benchmark.Benchmark): +class BlinkPerfCSS(perf_benchmark.PerfBenchmark): tag = 'css' test = _BlinkPerfMeasurement @@ -169,7 +171,7 @@ class BlinkPerfCSS(benchmark.Benchmark): @benchmark.Disabled('linux', # http://crbug.com/488059 'xp') # http://crbug.com/488059 -class BlinkPerfCanvas(benchmark.Benchmark): +class BlinkPerfCanvas(perf_benchmark.PerfBenchmark): tag = 'canvas' test = _BlinkPerfMeasurement @@ -182,7 +184,7 @@ class BlinkPerfCanvas(benchmark.Benchmark): return CreatePageSetFromPath(path, SKIPPED_FILE) -class BlinkPerfDOM(benchmark.Benchmark): +class BlinkPerfDOM(perf_benchmark.PerfBenchmark): tag = 'dom' test = _BlinkPerfMeasurement @@ -196,7 +198,7 @@ class BlinkPerfDOM(benchmark.Benchmark): @benchmark.Disabled('release_x64') # http://crbug.com/480999 -class BlinkPerfEvents(benchmark.Benchmark): +class BlinkPerfEvents(perf_benchmark.PerfBenchmark): tag = 'events' test = _BlinkPerfMeasurement @@ -210,7 +212,7 @@ class BlinkPerfEvents(benchmark.Benchmark): @benchmark.Disabled('win8') # http://crbug.com/462350 -class BlinkPerfLayout(benchmark.Benchmark): +class BlinkPerfLayout(perf_benchmark.PerfBenchmark): tag = 'layout' test = _BlinkPerfMeasurement @@ -233,7 +235,7 @@ class BlinkPerfLayoutFullLayout(BlinkPerfLayout): return 'blink_perf.layout_full_frame' -class BlinkPerfMutation(benchmark.Benchmark): +class BlinkPerfMutation(perf_benchmark.PerfBenchmark): tag = 'mutation' test = _BlinkPerfMeasurement @@ -247,7 +249,7 @@ class BlinkPerfMutation(benchmark.Benchmark): @benchmark.Disabled('win') # crbug.com/488493 -class BlinkPerfParser(benchmark.Benchmark): +class BlinkPerfParser(perf_benchmark.PerfBenchmark): tag = 'parser' test = _BlinkPerfMeasurement @@ -260,7 +262,7 @@ class BlinkPerfParser(benchmark.Benchmark): return CreatePageSetFromPath(path, SKIPPED_FILE) -class BlinkPerfSVG(benchmark.Benchmark): +class BlinkPerfSVG(perf_benchmark.PerfBenchmark): tag = 'svg' test = _BlinkPerfMeasurement @@ -283,7 +285,7 @@ class BlinkPerfSVGFullLayout(BlinkPerfSVG): return 'blink_perf.svg_full_frame' -class BlinkPerfShadowDOM(benchmark.Benchmark): +class BlinkPerfShadowDOM(perf_benchmark.PerfBenchmark): tag = 'shadow_dom' test = _BlinkPerfMeasurement @@ -298,7 +300,7 @@ class BlinkPerfShadowDOM(benchmark.Benchmark): # This benchmark is for local testing, doesn't need to run on bots. @benchmark.Disabled() -class BlinkPerfXMLHttpRequest(benchmark.Benchmark): +class BlinkPerfXMLHttpRequest(perf_benchmark.PerfBenchmark): tag = 'xml_http_request' test = _BlinkPerfMeasurement diff --git a/tools/perf/benchmarks/blink_style.py b/tools/perf/benchmarks/blink_style.py index c3f8fb2..b87ca98 100644 --- a/tools/perf/benchmarks/blink_style.py +++ b/tools/perf/benchmarks/blink_style.py @@ -2,13 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import blink_style +from telemetry import benchmark import page_sets + @benchmark.Disabled('reference', 'win8') -class BlinkStyleTop25(benchmark.Benchmark): +class BlinkStyleTop25(perf_benchmark.PerfBenchmark): """Measures performance of Blink's style engine (CSS Parsing, Style Recalc, etc.) on the top 25 pages. """ @@ -22,7 +24,7 @@ class BlinkStyleTop25(benchmark.Benchmark): @benchmark.Disabled('reference') @benchmark.Enabled('android') -class BlinkStyleKeyMobileSites(benchmark.Benchmark): +class BlinkStyleKeyMobileSites(perf_benchmark.PerfBenchmark): """Measures performance of Blink's style engine (CSS Parsing, Style Recalc, etc.) on key mobile sites. """ @@ -36,7 +38,7 @@ class BlinkStyleKeyMobileSites(benchmark.Benchmark): @benchmark.Disabled('reference') @benchmark.Enabled('android') -class BlinkStylePolymer(benchmark.Benchmark): +class BlinkStylePolymer(perf_benchmark.PerfBenchmark): """Measures performance of Blink's style engine (CSS Parsing, Style Recalc, etc.) for Polymer cases. """ diff --git a/tools/perf/benchmarks/dom_perf.py b/tools/perf/benchmarks/dom_perf.py index 7005da0..81ece8e 100644 --- a/tools/perf/benchmarks/dom_perf.py +++ b/tools/perf/benchmarks/dom_perf.py @@ -6,6 +6,8 @@ import json import math import os +from core import perf_benchmark + from telemetry import benchmark from telemetry.core import util from telemetry import page as page_module @@ -78,7 +80,7 @@ class _DomPerfMeasurement(page_test.PageTest): @benchmark.Disabled('android', 'linux') # http://crbug.com/458540 -class DomPerf(benchmark.Benchmark): +class DomPerf(perf_benchmark.PerfBenchmark): """A suite of JavaScript benchmarks for exercising the browser's DOM. The final score is computed as the geometric mean of the individual results. diff --git a/tools/perf/benchmarks/draw_properties.py b/tools/perf/benchmarks/draw_properties.py index b66ee3a..8817d51 100644 --- a/tools/perf/benchmarks/draw_properties.py +++ b/tools/perf/benchmarks/draw_properties.py @@ -2,15 +2,16 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import draw_properties +from telemetry import benchmark import page_sets # This benchmark depends on tracing categories available in M43 @benchmark.Disabled('reference') -class DrawPropertiesToughScrolling(benchmark.Benchmark): +class DrawPropertiesToughScrolling(perf_benchmark.PerfBenchmark): test = draw_properties.DrawProperties page_set = page_sets.ToughScrollingCasesPageSet @classmethod @@ -20,7 +21,7 @@ class DrawPropertiesToughScrolling(benchmark.Benchmark): # This benchmark depends on tracing categories available in M43 @benchmark.Disabled('reference','win') # http://crbug.com/463111 -class DrawPropertiesTop25(benchmark.Benchmark): +class DrawPropertiesTop25(perf_benchmark.PerfBenchmark): """Measures the performance of computing draw properties from property trees. http://www.chromium.org/developers/design-documents/rendering-benchmarks diff --git a/tools/perf/benchmarks/dromaeo.py b/tools/perf/benchmarks/dromaeo.py index b0f7d60..e507484 100644 --- a/tools/perf/benchmarks/dromaeo.py +++ b/tools/perf/benchmarks/dromaeo.py @@ -5,6 +5,8 @@ import math import os +from core import perf_benchmark + from telemetry import benchmark from telemetry import page as page_module from telemetry.page import page_set @@ -94,7 +96,7 @@ class _DromaeoMeasurement(page_test.PageTest): for key, value in aggregated.iteritems(): AddResult(key, math.exp(value['sum'] / value['count'])) -class _DromaeoBenchmark(benchmark.Benchmark): +class _DromaeoBenchmark(perf_benchmark.PerfBenchmark): """A base class for Dromaeo benchmarks.""" test = _DromaeoMeasurement diff --git a/tools/perf/benchmarks/gpu_times.py b/tools/perf/benchmarks/gpu_times.py index 6d73d74..cf00aef 100644 --- a/tools/perf/benchmarks/gpu_times.py +++ b/tools/perf/benchmarks/gpu_times.py @@ -1,19 +1,23 @@ # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. + +from core import perf_benchmark + +from benchmarks import silk_flags + from telemetry import benchmark from telemetry.core.platform import tracing_category_filter from telemetry.web_perf.metrics import gpu_timeline from telemetry.web_perf import timeline_based_measurement -from benchmarks import silk_flags import page_sets TOPLEVEL_CATEGORIES = ['disabled-by-default-gpu.device', 'disabled-by-default-gpu.service'] -class _GPUTimes(benchmark.Benchmark): +class _GPUTimes(perf_benchmark.PerfBenchmark): def CreateTimelineBasedMeasurementOptions(self): cat_string = ','.join(TOPLEVEL_CATEGORIES) cat_filter = tracing_category_filter.TracingCategoryFilter(cat_string) @@ -40,7 +44,7 @@ class GPUTimesGpuRasterizationKeyMobileSites(_GPUTimes): """Measures GPU timeline metric on key mobile sites with GPU rasterization. """ page_set = page_sets.KeyMobileSitesSmoothPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod @@ -61,7 +65,7 @@ class GPUTimesGpuRasterizationTop25Sites(_GPUTimes): """Measures GPU timeline metric for the top 25 sites with GPU rasterization. """ page_set = page_sets.Top25SmoothPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod diff --git a/tools/perf/benchmarks/image_decoding.py b/tools/perf/benchmarks/image_decoding.py index 1dff0cd..96b2c35 100644 --- a/tools/perf/benchmarks/image_decoding.py +++ b/tools/perf/benchmarks/image_decoding.py @@ -2,13 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import image_decoding import page_sets -class ImageDecodingToughImageCases(benchmark.Benchmark): +class ImageDecodingToughImageCases(perf_benchmark.PerfBenchmark): test = image_decoding.ImageDecoding # TODO: Rename this page set to tough_image_cases.py page_set = page_sets.ImageDecodingMeasurementPageSet diff --git a/tools/perf/benchmarks/inbox_benchmark.py b/tools/perf/benchmarks/inbox_benchmark.py index c25382f..124d235 100644 --- a/tools/perf/benchmarks/inbox_benchmark.py +++ b/tools/perf/benchmarks/inbox_benchmark.py @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from core import perf_benchmark + from telemetry import benchmark from telemetry.web_perf import timeline_based_measurement @@ -9,7 +11,7 @@ from page_sets import inbox @benchmark.Disabled # http://crbug.com/452257 -class Inbox(benchmark.Benchmark): +class Inbox(perf_benchmark.PerfBenchmark): """Runs the timeline based measurement against inbox pageset.""" test = timeline_based_measurement.TimelineBasedMeasurement diff --git a/tools/perf/benchmarks/indexeddb_perf.py b/tools/perf/benchmarks/indexeddb_perf.py index 65a8710..c7f882e 100644 --- a/tools/perf/benchmarks/indexeddb_perf.py +++ b/tools/perf/benchmarks/indexeddb_perf.py @@ -22,7 +22,8 @@ Cursors: import json import os -from telemetry import benchmark +from core import perf_benchmark + from telemetry.core import util from telemetry import page as page_module from telemetry.page import page_set @@ -81,7 +82,7 @@ class _IndexedDbMeasurement(page_test.PageTest): memory.MemoryMetric.CustomizeBrowserOptions(options) power.PowerMetric.CustomizeBrowserOptions(options) -class IndexedDb(benchmark.Benchmark): +class IndexedDb(perf_benchmark.PerfBenchmark): """Chromium's IndexedDB Performance tests.""" test = _IndexedDbMeasurement diff --git a/tools/perf/benchmarks/jetstream.py b/tools/perf/benchmarks/jetstream.py index 7b560c3..90620cd 100644 --- a/tools/perf/benchmarks/jetstream.py +++ b/tools/perf/benchmarks/jetstream.py @@ -20,6 +20,8 @@ specialized optimization for one benchmark might make another benchmark slower. import json import os +from core import perf_benchmark + from telemetry import benchmark from telemetry import page as page_module from telemetry.page import page_set @@ -77,7 +79,7 @@ class _JetstreamMeasurement(page_test.PageTest): @benchmark.Disabled('android', 'xp') # crbug.com/381742 -class Jetstream(benchmark.Benchmark): +class Jetstream(perf_benchmark.PerfBenchmark): test = _JetstreamMeasurement @classmethod diff --git a/tools/perf/benchmarks/kraken.py b/tools/perf/benchmarks/kraken.py index 724dcf8..0ddc0c4 100644 --- a/tools/perf/benchmarks/kraken.py +++ b/tools/perf/benchmarks/kraken.py @@ -6,7 +6,8 @@ import os -from telemetry import benchmark +from core import perf_benchmark + from telemetry import page as page_module from telemetry.page import page_set from telemetry.page import page_test @@ -113,7 +114,7 @@ class _KrakenMeasurement(page_test.PageTest): '(http://krakenbenchmark.mozilla.org/)')) -class Kraken(benchmark.Benchmark): +class Kraken(perf_benchmark.PerfBenchmark): """Mozilla's Kraken JavaScript benchmark. http://krakenbenchmark.mozilla.org/ diff --git a/tools/perf/benchmarks/maps.py b/tools/perf/benchmarks/maps.py index 442fb41..f685191 100644 --- a/tools/perf/benchmarks/maps.py +++ b/tools/perf/benchmarks/maps.py @@ -8,6 +8,8 @@ Rerforms several common navigation actions on the map (pan, zoom, rotate)""" import os import re +from core import perf_benchmark + from telemetry import benchmark from telemetry.core import util from telemetry.page import page as page_module @@ -45,7 +47,7 @@ class MapsPage(page_module.Page): @benchmark.Disabled -class MapsBenchmark(benchmark.Benchmark): +class MapsBenchmark(perf_benchmark.PerfBenchmark): """Basic Google Maps benchmarks.""" test = _MapsMeasurement @@ -70,5 +72,5 @@ class MapsNoVsync(MapsBenchmark): def Name(cls): return 'maps.novsync' - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): options.AppendExtraBrowserArgs('--disable-gpu-vsync') diff --git a/tools/perf/benchmarks/media.py b/tools/perf/benchmarks/media.py index 3a44ff4..7e50ef6 100644 --- a/tools/perf/benchmarks/media.py +++ b/tools/perf/benchmarks/media.py @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from core import perf_benchmark + from telemetry import benchmark from telemetry.page import page_test from telemetry.value import list_of_scalar_values @@ -35,7 +37,7 @@ class _MSEMeasurement(page_test.PageTest): @benchmark.Disabled('android', # See media.android.tough_video_cases below 'xp') # crbug.com/475191 -class Media(benchmark.Benchmark): +class Media(perf_benchmark.PerfBenchmark): """Obtains media metrics for key user scenarios.""" test = media.Media page_set = page_sets.ToughVideoCasesPageSet @@ -46,7 +48,7 @@ class Media(benchmark.Benchmark): @benchmark.Disabled('android', 'mac', 'xp') -class MediaNetworkSimulation(benchmark.Benchmark): +class MediaNetworkSimulation(perf_benchmark.PerfBenchmark): """Obtains media metrics under different network simulations.""" test = media.Media page_set = page_sets.MediaCnsCasesPageSet @@ -58,7 +60,7 @@ class MediaNetworkSimulation(benchmark.Benchmark): @benchmark.Disabled() # crbug.com/448092 @benchmark.Disabled('l', 'android-webview') # WebView: crbug.com/419689 -class MediaAndroid(benchmark.Benchmark): +class MediaAndroid(perf_benchmark.PerfBenchmark): """Obtains media metrics for key user scenarios on Android.""" test = media.Media tag = 'android' @@ -72,7 +74,7 @@ class MediaAndroid(benchmark.Benchmark): @benchmark.Enabled('chromeos') -class MediaChromeOS4kOnly(benchmark.Benchmark): +class MediaChromeOS4kOnly(perf_benchmark.PerfBenchmark): """Benchmark for media performance on ChromeOS using only is_4k test content. """ test = media.Media @@ -90,7 +92,7 @@ class MediaChromeOS4kOnly(benchmark.Benchmark): @benchmark.Enabled('chromeos') -class MediaChromeOS(benchmark.Benchmark): +class MediaChromeOS(perf_benchmark.PerfBenchmark): """Benchmark for media performance on all ChromeOS platforms. This benchmark does not run is_4k content, there's a separate benchmark for @@ -108,7 +110,7 @@ class MediaChromeOS(benchmark.Benchmark): @benchmark.Disabled('android-webview') # crbug.com/419689 -class MediaSourceExtensions(benchmark.Benchmark): +class MediaSourceExtensions(perf_benchmark.PerfBenchmark): """Obtains media metrics for key media source extensions functions.""" test = _MSEMeasurement page_set = page_sets.MseCasesPageSet @@ -117,7 +119,7 @@ class MediaSourceExtensions(benchmark.Benchmark): def Name(cls): return 'media.mse_cases' - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): # Needed to allow XHR requests to return stream objects. options.AppendExtraBrowserArgs( ['--enable-experimental-web-platform-features', diff --git a/tools/perf/benchmarks/memory.py b/tools/perf/benchmarks/memory.py index 38ed2e3..a7388af 100644 --- a/tools/perf/benchmarks/memory.py +++ b/tools/perf/benchmarks/memory.py @@ -2,14 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import memory +from telemetry import benchmark import page_sets @benchmark.Enabled('android') -class MemoryMobile(benchmark.Benchmark): +class MemoryMobile(perf_benchmark.PerfBenchmark): test = memory.Memory page_set = page_sets.MobileMemoryPageSet @@ -18,7 +19,7 @@ class MemoryMobile(benchmark.Benchmark): return 'memory.mobile_memory' -class MemoryTop7Stress(benchmark.Benchmark): +class MemoryTop7Stress(perf_benchmark.PerfBenchmark): """Use (recorded) real world web sites and measure memory consumption.""" test = memory.Memory page_set = page_sets.Top7StressPageSet @@ -28,14 +29,14 @@ class MemoryTop7Stress(benchmark.Benchmark): return 'memory.top_7_stress' -class MemoryTop7StressWithSlimmingPaint(benchmark.Benchmark): +class MemoryTop7StressWithSlimmingPaint(perf_benchmark.PerfBenchmark): """Use (recorded) real world web sites and measure memory consumption, with --enable--slimming-paint.""" test = memory.Memory page_set = page_sets.Top7StressPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): options.AppendExtraBrowserArgs(['--enable-slimming-paint']) @classmethod @@ -46,13 +47,13 @@ class MemoryTop7StressWithSlimmingPaint(benchmark.Benchmark): # @benchmark.Enabled('has tabs') # @benchmark.Disabled('android') # Benchmark uses > 700MB of memory. @benchmark.Disabled # crbug.com/490841 -class MemoryIdleMultiTab(benchmark.Benchmark): +class MemoryIdleMultiTab(perf_benchmark.PerfBenchmark): """Use (recorded) real world web sites and measure memory consumption with many tabs and idle times. """ test = memory.Memory page_set = page_sets.IdleMultiTabCasesPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): # This benchmark opens tabs from JavaScript, which does not work # with popup-blocking enabled. options.AppendExtraBrowserArgs(['--disable-popup-blocking']) diff --git a/tools/perf/benchmarks/new_tab.py b/tools/perf/benchmarks/new_tab.py index 961f0e7..2071c38 100644 --- a/tools/perf/benchmarks/new_tab.py +++ b/tools/perf/benchmarks/new_tab.py @@ -1,6 +1,9 @@ # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. + +from core import perf_benchmark + from telemetry import benchmark from telemetry.web_perf import timeline_based_measurement @@ -8,7 +11,7 @@ import page_sets @benchmark.Disabled('android') -class NewTabPage(benchmark.Benchmark): +class NewTabPage(perf_benchmark.PerfBenchmark): """Timeline based measurement benchmark for the New Tab Page.""" page_set = page_sets.NewTabPagePageSet diff --git a/tools/perf/benchmarks/octane.py b/tools/perf/benchmarks/octane.py index 657d52d..d9cb462 100644 --- a/tools/perf/benchmarks/octane.py +++ b/tools/perf/benchmarks/octane.py @@ -13,7 +13,8 @@ Octane 2.0 consists of 17 tests, four more than Octane v1. import os -from telemetry import benchmark +from core import perf_benchmark + from telemetry import page as page_module from telemetry.page import page_set from telemetry.page import page_test @@ -130,7 +131,7 @@ class _OctaneMeasurement(page_test.PageTest): 'benchmark collection.')) -class Octane(benchmark.Benchmark): +class Octane(perf_benchmark.PerfBenchmark): """Google's Octane JavaScript benchmark. http://octane-benchmark.googlecode.com/svn/latest/index.html diff --git a/tools/perf/benchmarks/oilpan_gc_times.py b/tools/perf/benchmarks/oilpan_gc_times.py index 9606aa7..5c77aa9 100644 --- a/tools/perf/benchmarks/oilpan_gc_times.py +++ b/tools/perf/benchmarks/oilpan_gc_times.py @@ -4,15 +4,16 @@ import os -from telemetry import benchmark +from core import perf_benchmark from benchmarks import blink_perf from benchmarks import silk_flags from measurements import oilpan_gc_times +from telemetry import benchmark import page_sets -class OilpanGCTimesBlinkPerfAnimation(benchmark.Benchmark): +class OilpanGCTimesBlinkPerfAnimation(perf_benchmark.PerfBenchmark): tag = 'blink_perf_animation' test = oilpan_gc_times.OilpanGCTimesForBlinkPerf @@ -26,7 +27,7 @@ class OilpanGCTimesBlinkPerfAnimation(benchmark.Benchmark): @benchmark.Enabled('content-shell') -class OilpanGCTimesBlinkPerfStress(benchmark.Benchmark): +class OilpanGCTimesBlinkPerfStress(perf_benchmark.PerfBenchmark): tag = 'blink_perf_stress' test = oilpan_gc_times.OilpanGCTimesForInternals @@ -39,7 +40,7 @@ class OilpanGCTimesBlinkPerfStress(benchmark.Benchmark): return blink_perf.CreatePageSetFromPath(path, blink_perf.SKIPPED_FILE) -class OilpanGCTimesSmoothnessAnimation(benchmark.Benchmark): +class OilpanGCTimesSmoothnessAnimation(perf_benchmark.PerfBenchmark): test = oilpan_gc_times.OilpanGCTimesForSmoothness page_set = page_sets.ToughAnimationCasesPageSet @@ -49,7 +50,7 @@ class OilpanGCTimesSmoothnessAnimation(benchmark.Benchmark): @benchmark.Enabled('android') -class OilpanGCTimesKeySilkCases(benchmark.Benchmark): +class OilpanGCTimesKeySilkCases(perf_benchmark.PerfBenchmark): test = oilpan_gc_times.OilpanGCTimesForSmoothness page_set = page_sets.KeySilkCasesPageSet @@ -59,11 +60,11 @@ class OilpanGCTimesKeySilkCases(benchmark.Benchmark): @benchmark.Enabled('android') -class OilpanGCTimesSyncScrollKeyMobileSites(benchmark.Benchmark): +class OilpanGCTimesSyncScrollKeyMobileSites(perf_benchmark.PerfBenchmark): tag = 'sync_scroll' test = oilpan_gc_times.OilpanGCTimesForSmoothness page_set = page_sets.KeyMobileSitesSmoothPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForSyncScrolling(options) @classmethod def Name(cls): diff --git a/tools/perf/benchmarks/page_cycler.py b/tools/perf/benchmarks/page_cycler.py index 93138df..7cd924b 100644 --- a/tools/perf/benchmarks/page_cycler.py +++ b/tools/perf/benchmarks/page_cycler.py @@ -2,13 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import page_cycler +from telemetry import benchmark import page_sets -class _PageCycler(benchmark.Benchmark): +class _PageCycler(perf_benchmark.PerfBenchmark): options = {'pageset_repeat': 6} cold_load_percent = 50 # % of page visits for which a cold load is forced @@ -226,7 +227,7 @@ class PageCyclerOopifTypical25(_PageCycler): def Name(cls): return 'page_cycler_oopif.typical_25' - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): options.AppendExtraBrowserArgs(['--site-per-process']) def CreatePageSet(self, options): diff --git a/tools/perf/benchmarks/polymer_load.py b/tools/perf/benchmarks/polymer_load.py index 17caf5a..929a4ed 100644 --- a/tools/perf/benchmarks/polymer_load.py +++ b/tools/perf/benchmarks/polymer_load.py @@ -2,14 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import polymer_load +from telemetry import benchmark import page_sets @benchmark.Enabled('android') -class PolymerLoadPica(benchmark.Benchmark): +class PolymerLoadPica(perf_benchmark.PerfBenchmark): """Measures time to polymer-ready for Pica (News Reader).""" test = polymer_load.PolymerLoadMeasurement page_set = page_sets.PicaPageSet @@ -25,7 +26,7 @@ class PolymerLoadPica(benchmark.Benchmark): # See crbug.com/428207. #@benchmark.Enabled('android') @benchmark.Disabled -class PolymerLoadTopeka(benchmark.Benchmark): +class PolymerLoadTopeka(perf_benchmark.PerfBenchmark): """Measures time to polymer-ready for Topeka (Quiz App).""" test = polymer_load.PolymerLoadMeasurement page_set = page_sets.TopekaPageSet diff --git a/tools/perf/benchmarks/power.py b/tools/perf/benchmarks/power.py index 4a1aeaf..ba29d15 100644 --- a/tools/perf/benchmarks/power.py +++ b/tools/perf/benchmarks/power.py @@ -2,15 +2,16 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from benchmarks import silk_flags from measurements import power +from telemetry import benchmark import page_sets @benchmark.Enabled('android') -class PowerAndroidAcceptance(benchmark.Benchmark): +class PowerAndroidAcceptance(perf_benchmark.PerfBenchmark): """Android power acceptance test.""" test = power.Power page_set = page_sets.AndroidAcceptancePageSet @@ -20,7 +21,7 @@ class PowerAndroidAcceptance(benchmark.Benchmark): @benchmark.Enabled('android') -class PowerTypical10Mobile(benchmark.Benchmark): +class PowerTypical10Mobile(perf_benchmark.PerfBenchmark): """Android typical 10 mobile power test.""" test = power.Power page_set = page_sets.Typical10MobilePageSet @@ -29,13 +30,13 @@ class PowerTypical10Mobile(benchmark.Benchmark): return 'power.typical_10_mobile' @benchmark.Enabled('android') -class PowerGpuRasterizationTypical10Mobile(benchmark.Benchmark): +class PowerGpuRasterizationTypical10Mobile(perf_benchmark.PerfBenchmark): """Measures power on key mobile sites with GPU rasterization.""" tag = 'gpu_rasterization' test = power.Power page_set = page_sets.Typical10MobilePageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod @@ -43,7 +44,7 @@ class PowerGpuRasterizationTypical10Mobile(benchmark.Benchmark): return 'power.gpu_rasterization.typical_10_mobile' @benchmark.Enabled('mac') -class PowerTop10(benchmark.Benchmark): +class PowerTop10(perf_benchmark.PerfBenchmark): """Top 10 quiescent power test.""" test = power.QuiescentPower page_set = page_sets.Top10PageSet @@ -53,7 +54,7 @@ class PowerTop10(benchmark.Benchmark): @benchmark.Enabled('mac') -class PowerTop25(benchmark.Benchmark): +class PowerTop25(perf_benchmark.PerfBenchmark): """Top 25 quiescent power test.""" test = power.QuiescentPower page_set = page_sets.Top25PageSet diff --git a/tools/perf/benchmarks/rasterize_and_record_micro.py b/tools/perf/benchmarks/rasterize_and_record_micro.py index e7eba0e..67200be 100644 --- a/tools/perf/benchmarks/rasterize_and_record_micro.py +++ b/tools/perf/benchmarks/rasterize_and_record_micro.py @@ -2,13 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import rasterize_and_record_micro +from telemetry import benchmark import page_sets -class _RasterizeAndRecordMicro(benchmark.Benchmark): +class _RasterizeAndRecordMicro(perf_benchmark.PerfBenchmark): @classmethod def AddBenchmarkCommandLineArgs(cls, parser): parser.add_option('--start-wait-time', type='float', @@ -66,7 +67,7 @@ class RasterizeAndRecordMicroTop25WithSlimmingPaint(_RasterizeAndRecordMicro): http://www.chromium.org/developers/design-documents/rendering-benchmarks""" page_set = page_sets.Top25PageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): options.AppendExtraBrowserArgs(['--enable-slimming-paint']) @classmethod diff --git a/tools/perf/benchmarks/repaint.py b/tools/perf/benchmarks/repaint.py index e2cc95e..5d0b6e0 100644 --- a/tools/perf/benchmarks/repaint.py +++ b/tools/perf/benchmarks/repaint.py @@ -2,14 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from benchmarks import silk_flags from measurements import smoothness +from telemetry import benchmark import page_sets -class _Repaint(benchmark.Benchmark): +class _Repaint(perf_benchmark.PerfBenchmark): @classmethod def AddBenchmarkCommandLineArgs(cls, parser): parser.add_option('--mode', type='string', @@ -52,7 +53,7 @@ class RepaintGpuRasterizationKeyMobileSites(_Repaint): http://www.chromium.org/developers/design-documents/rendering-benchmarks""" tag = 'gpu_rasterization' - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod diff --git a/tools/perf/benchmarks/robohornet_pro.py b/tools/perf/benchmarks/robohornet_pro.py index f299089..05ccc80 100644 --- a/tools/perf/benchmarks/robohornet_pro.py +++ b/tools/perf/benchmarks/robohornet_pro.py @@ -6,6 +6,8 @@ import os +from core import perf_benchmark + from telemetry import benchmark from telemetry import page as page_module from telemetry.page import page_set @@ -47,7 +49,7 @@ class _RobohornetProMeasurement(page_test.PageTest): # we need to wait until Chrome OS can implement support for more helpful # benchmarks. @benchmark.Enabled('chromeos') -class RobohornetPro(benchmark.Benchmark): +class RobohornetPro(perf_benchmark.PerfBenchmark): """Milliseconds to complete the RoboHornetPro demo by Microsoft. http://ie.microsoft.com/testdrive/performance/robohornetpro/ diff --git a/tools/perf/benchmarks/scheduler.py b/tools/perf/benchmarks/scheduler.py index 39b1702..294ff8d 100644 --- a/tools/perf/benchmarks/scheduler.py +++ b/tools/perf/benchmarks/scheduler.py @@ -2,13 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import smoothness import page_sets -class SchedulerToughSchedulingCases(benchmark.Benchmark): +class SchedulerToughSchedulingCases(perf_benchmark.PerfBenchmark): """Measures rendering statistics while interacting with pages that have challenging scheduling properties. diff --git a/tools/perf/benchmarks/service_worker.py b/tools/perf/benchmarks/service_worker.py index 7e2c94e..c4b11f4 100644 --- a/tools/perf/benchmarks/service_worker.py +++ b/tools/perf/benchmarks/service_worker.py @@ -6,6 +6,8 @@ import collections import page_sets import re +from core import perf_benchmark + from telemetry import benchmark from telemetry.core import util from telemetry.page import action_runner @@ -188,7 +190,7 @@ class _ServiceWorkerMicroBenchmarkMeasurement(page_test.PageTest): browser_process, 'IOThread', filter_text , results) -class ServiceWorkerPerfTest(benchmark.Benchmark): +class ServiceWorkerPerfTest(perf_benchmark.PerfBenchmark): """Performance test on public applications using ServiceWorker""" test = _ServiceWorkerMeasurement page_set = page_sets.ServiceWorkerPageSet @@ -201,7 +203,7 @@ class ServiceWorkerPerfTest(benchmark.Benchmark): # Disabled due to redness on the tree. crbug.com/442752 # TODO(horo): Enable after the reference build newer than M39 will be rolled. @benchmark.Disabled('reference') -class ServiceWorkerMicroBenchmarkPerfTest(benchmark.Benchmark): +class ServiceWorkerMicroBenchmarkPerfTest(perf_benchmark.PerfBenchmark): """This test measures the performance of pages using ServiceWorker. As a page set, two benchamrk pages (many registration, many concurrent diff --git a/tools/perf/benchmarks/session_restore.py b/tools/perf/benchmarks/session_restore.py index 86509f3..541bd3a 100644 --- a/tools/perf/benchmarks/session_restore.py +++ b/tools/perf/benchmarks/session_restore.py @@ -5,15 +5,16 @@ import os import tempfile -from telemetry import benchmark +from core import perf_benchmark from measurements import session_restore -import page_sets from profile_creators import profile_generator from profile_creators import small_profile_extender +from telemetry import benchmark +import page_sets -class _SessionRestoreTypical25(benchmark.Benchmark): +class _SessionRestoreTypical25(perf_benchmark.PerfBenchmark): """Base Benchmark class for session restore benchmarks. A cold start means none of the Chromium files are in the disk cache. diff --git a/tools/perf/benchmarks/skpicture_printer.py b/tools/perf/benchmarks/skpicture_printer.py index 8ba3d89..9d5979b 100644 --- a/tools/perf/benchmarks/skpicture_printer.py +++ b/tools/perf/benchmarks/skpicture_printer.py @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from core import perf_benchmark + from telemetry import benchmark from telemetry.core import discover from telemetry.page import page_set @@ -21,7 +23,7 @@ def _MatchPageSetName(page_set_name, page_set_base_dir): @benchmark.Disabled -class SkpicturePrinter(benchmark.Benchmark): +class SkpicturePrinter(perf_benchmark.PerfBenchmark): @classmethod def AddBenchmarkCommandLineArgs(cls, parser): parser.add_option('--page-set-name', action='store', type='string') diff --git a/tools/perf/benchmarks/smoothness.py b/tools/perf/benchmarks/smoothness.py index 8d3df64..0c26ca5 100644 --- a/tools/perf/benchmarks/smoothness.py +++ b/tools/perf/benchmarks/smoothness.py @@ -2,15 +2,16 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from benchmarks import silk_flags from benchmarks import webgl_expectations from measurements import smoothness +from telemetry import benchmark import page_sets -class SmoothnessTop25(benchmark.Benchmark): +class SmoothnessTop25(perf_benchmark.PerfBenchmark): """Measures rendering statistics while scrolling down the top 25 web pages. http://www.chromium.org/developers/design-documents/rendering-benchmarks @@ -23,7 +24,7 @@ class SmoothnessTop25(benchmark.Benchmark): return 'smoothness.top_25_smooth' -class SmoothnessToughFiltersCases(benchmark.Benchmark): +class SmoothnessToughFiltersCases(perf_benchmark.PerfBenchmark): """Measures frame rate and a variety of other statistics. Uses a selection of pages making use of SVG and CSS Filter Effects. @@ -36,7 +37,7 @@ class SmoothnessToughFiltersCases(benchmark.Benchmark): return 'smoothness.tough_filters_cases' -class SmoothnessToughPathRenderingCases(benchmark.Benchmark): +class SmoothnessToughPathRenderingCases(perf_benchmark.PerfBenchmark): """Tests a selection of pages with SVG and 2D Canvas paths. Measures frame rate and a variety of other statistics. """ @@ -50,7 +51,7 @@ class SmoothnessToughPathRenderingCases(benchmark.Benchmark): # crbug.com/388877, crbug.com/396127 @benchmark.Disabled('mac', 'win', 'android') -class SmoothnessToughCanvasCases(benchmark.Benchmark): +class SmoothnessToughCanvasCases(perf_benchmark.PerfBenchmark): """Measures frame rate and a variety of other statistics. Uses a selection of pages making use of the 2D Canvas API. @@ -64,7 +65,7 @@ class SmoothnessToughCanvasCases(benchmark.Benchmark): @benchmark.Disabled('android') # crbug.com/373812 -class SmoothnessToughWebGLCases(benchmark.Benchmark): +class SmoothnessToughWebGLCases(perf_benchmark.PerfBenchmark): test = smoothness.Smoothness page_set = page_sets.ToughWebglCasesPageSet @@ -78,7 +79,7 @@ class SmoothnessToughWebGLCases(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessMaps(benchmark.Benchmark): +class SmoothnessMaps(perf_benchmark.PerfBenchmark): page_set = page_sets.MapsPageSet @classmethod @@ -91,7 +92,7 @@ class SmoothnessMaps(benchmark.Benchmark): @benchmark.Disabled('android') -class SmoothnessKeyDesktopMoveCases(benchmark.Benchmark): +class SmoothnessKeyDesktopMoveCases(perf_benchmark.PerfBenchmark): test = smoothness.Smoothness page_set = page_sets.KeyDesktopMoveCasesPageSet @@ -101,7 +102,7 @@ class SmoothnessKeyDesktopMoveCases(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessKeyMobileSites(benchmark.Benchmark): +class SmoothnessKeyMobileSites(perf_benchmark.PerfBenchmark): """Measures rendering statistics while scrolling down the key mobile sites. http://www.chromium.org/developers/design-documents/rendering-benchmarks @@ -115,7 +116,7 @@ class SmoothnessKeyMobileSites(benchmark.Benchmark): @benchmark.Disabled('mac', 'win', 'android') -class SmoothnessKeyMobileSitesWithSlimmingPaint(benchmark.Benchmark): +class SmoothnessKeyMobileSitesWithSlimmingPaint(perf_benchmark.PerfBenchmark): """Measures smoothness on key mobile sites with --enable-slimming-paint. http://www.chromium.org/developers/design-documents/rendering-benchmarks @@ -123,7 +124,7 @@ class SmoothnessKeyMobileSitesWithSlimmingPaint(benchmark.Benchmark): test = smoothness.Smoothness page_set = page_sets.KeyMobileSitesSmoothPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): options.AppendExtraBrowserArgs(['--enable-slimming-paint']) @classmethod @@ -131,7 +132,7 @@ class SmoothnessKeyMobileSitesWithSlimmingPaint(benchmark.Benchmark): return 'smoothness.key_mobile_sites_with_slimming_paint_smooth' -class SmoothnessToughAnimationCases(benchmark.Benchmark): +class SmoothnessToughAnimationCases(perf_benchmark.PerfBenchmark): test = smoothness.SmoothnessWithRestart page_set = page_sets.ToughAnimationCasesPageSet @@ -141,7 +142,7 @@ class SmoothnessToughAnimationCases(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessKeySilkCases(benchmark.Benchmark): +class SmoothnessKeySilkCases(perf_benchmark.PerfBenchmark): """Measures rendering statistics for the key silk cases without GPU rasterization. """ @@ -154,14 +155,14 @@ class SmoothnessKeySilkCases(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessGpuRasterizationTop25(benchmark.Benchmark): +class SmoothnessGpuRasterizationTop25(perf_benchmark.PerfBenchmark): """Measures rendering statistics for the top 25 with GPU rasterization. """ tag = 'gpu_rasterization' test = smoothness.Smoothness page_set = page_sets.Top25SmoothPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod @@ -170,7 +171,7 @@ class SmoothnessGpuRasterizationTop25(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessGpuRasterizationKeyMobileSites(benchmark.Benchmark): +class SmoothnessGpuRasterizationKeyMobileSites(perf_benchmark.PerfBenchmark): """Measures rendering statistics for the key mobile sites with GPU rasterization. """ @@ -178,7 +179,7 @@ class SmoothnessGpuRasterizationKeyMobileSites(benchmark.Benchmark): test = smoothness.Smoothness page_set = page_sets.KeyMobileSitesSmoothPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod @@ -186,7 +187,8 @@ class SmoothnessGpuRasterizationKeyMobileSites(benchmark.Benchmark): return 'smoothness.gpu_rasterization.key_mobile_sites_smooth' -class SmoothnessGpuRasterizationToughPathRenderingCases(benchmark.Benchmark): +class SmoothnessGpuRasterizationToughPathRenderingCases( + perf_benchmark.PerfBenchmark): """Tests a selection of pages with SVG and 2D canvas paths with GPU rasterization. """ @@ -194,7 +196,7 @@ class SmoothnessGpuRasterizationToughPathRenderingCases(benchmark.Benchmark): test = smoothness.Smoothness page_set = page_sets.ToughPathRenderingCasesPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod @@ -202,7 +204,7 @@ class SmoothnessGpuRasterizationToughPathRenderingCases(benchmark.Benchmark): return 'smoothness.gpu_rasterization.tough_path_rendering_cases' -class SmoothnessGpuRasterizationFiltersCases(benchmark.Benchmark): +class SmoothnessGpuRasterizationFiltersCases(perf_benchmark.PerfBenchmark): """Tests a selection of pages with SVG and CSS filter effects with GPU rasterization. """ @@ -210,7 +212,7 @@ class SmoothnessGpuRasterizationFiltersCases(benchmark.Benchmark): test = smoothness.Smoothness page_set = page_sets.ToughFiltersCasesPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod @@ -219,7 +221,7 @@ class SmoothnessGpuRasterizationFiltersCases(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessSyncScrollKeyMobileSites(benchmark.Benchmark): +class SmoothnessSyncScrollKeyMobileSites(perf_benchmark.PerfBenchmark): """Measures rendering statistics for the key mobile sites with synchronous (main thread) scrolling. """ @@ -227,7 +229,7 @@ class SmoothnessSyncScrollKeyMobileSites(benchmark.Benchmark): test = smoothness.Smoothness page_set = page_sets.KeyMobileSitesSmoothPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForSyncScrolling(options) @classmethod @@ -236,7 +238,7 @@ class SmoothnessSyncScrollKeyMobileSites(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessSimpleMobilePages(benchmark.Benchmark): +class SmoothnessSimpleMobilePages(perf_benchmark.PerfBenchmark): """Measures rendering statistics for simple mobile sites page set. """ test = smoothness.Smoothness @@ -248,13 +250,13 @@ class SmoothnessSimpleMobilePages(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessFlingSimpleMobilePages(benchmark.Benchmark): +class SmoothnessFlingSimpleMobilePages(perf_benchmark.PerfBenchmark): """Measures rendering statistics for flinging a simple mobile sites page set. """ test = smoothness.Smoothness page_set = page_sets.SimpleMobileSitesFlingPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): # As the fling parameters cannot be analytically determined to not # overscroll, disable overscrolling explicitly. Overscroll behavior is # orthogonal to fling performance, and its activation is only more noise. @@ -266,7 +268,7 @@ class SmoothnessFlingSimpleMobilePages(benchmark.Benchmark): @benchmark.Enabled('android', 'chromeos') -class SmoothnessToughPinchZoomCases(benchmark.Benchmark): +class SmoothnessToughPinchZoomCases(perf_benchmark.PerfBenchmark): """Measures rendering statistics for pinch-zooming into the tough pinch zoom cases. """ @@ -279,7 +281,7 @@ class SmoothnessToughPinchZoomCases(benchmark.Benchmark): @benchmark.Enabled('android', 'chromeos') -class SmoothnessToughScrollingWhileZoomedInCases(benchmark.Benchmark): +class SmoothnessToughScrollingWhileZoomedInCases(perf_benchmark.PerfBenchmark): """Measures rendering statistics for pinch-zooming then diagonal scrolling""" test = smoothness.Smoothness page_set = page_sets.ToughScrollingWhileZoomedInCasesPageSet @@ -290,7 +292,7 @@ class SmoothnessToughScrollingWhileZoomedInCases(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessPolymer(benchmark.Benchmark): +class SmoothnessPolymer(perf_benchmark.PerfBenchmark): """Measures rendering statistics for Polymer cases. """ test = smoothness.Smoothness @@ -302,14 +304,14 @@ class SmoothnessPolymer(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessGpuRasterizationPolymer(benchmark.Benchmark): +class SmoothnessGpuRasterizationPolymer(perf_benchmark.PerfBenchmark): """Measures rendering statistics for the Polymer cases with GPU rasterization. """ tag = 'gpu_rasterization' test = smoothness.Smoothness page_set = page_sets.PolymerPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) @classmethod @@ -317,7 +319,7 @@ class SmoothnessGpuRasterizationPolymer(benchmark.Benchmark): return 'smoothness.gpu_rasterization.polymer' -class SmoothnessToughScrollingCases(benchmark.Benchmark): +class SmoothnessToughScrollingCases(perf_benchmark.PerfBenchmark): test = smoothness.Smoothness page_set = page_sets.ToughScrollingCasesPageSet @@ -326,13 +328,13 @@ class SmoothnessToughScrollingCases(benchmark.Benchmark): return 'smoothness.tough_scrolling_cases' -class SmoothnessImageDecodingCases(benchmark.Benchmark): +class SmoothnessImageDecodingCases(perf_benchmark.PerfBenchmark): """Measures decoding statistics for jpeg images. """ test = smoothness.Smoothness page_set = page_sets.ImageDecodingCasesPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) options.AppendExtraBrowserArgs('--disable-accelerated-jpeg-decoding') @@ -341,14 +343,14 @@ class SmoothnessImageDecodingCases(benchmark.Benchmark): return 'smoothness.image_decoding_cases' -class SmoothnessGpuImageDecodingCases(benchmark.Benchmark): +class SmoothnessGpuImageDecodingCases(perf_benchmark.PerfBenchmark): """Measures decoding statistics for jpeg images with GPU rasterization. """ tag = 'gpu_rasterization_and_decoding' test = smoothness.Smoothness page_set = page_sets.ImageDecodingCasesPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) # TODO(sugoi): Remove the following line once M41 goes stable options.AppendExtraBrowserArgs('--enable-accelerated-jpeg-decoding') @@ -359,7 +361,7 @@ class SmoothnessGpuImageDecodingCases(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessPathologicalMobileSites(benchmark.Benchmark): +class SmoothnessPathologicalMobileSites(perf_benchmark.PerfBenchmark): """Measures task execution statistics while scrolling pathological sites. """ test = smoothness.Smoothness @@ -371,14 +373,14 @@ class SmoothnessPathologicalMobileSites(benchmark.Benchmark): @benchmark.Enabled('android') -class SmoothnessSyncScrollPathologicalMobileSites(benchmark.Benchmark): +class SmoothnessSyncScrollPathologicalMobileSites(perf_benchmark.PerfBenchmark): """Measures task execution statistics while sync-scrolling pathological sites. """ tag = 'sync_scroll' page_set = page_sets.PathologicalMobileSitesPageSet test = smoothness.Smoothness - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForSyncScrolling(options) @classmethod @@ -386,7 +388,7 @@ class SmoothnessSyncScrollPathologicalMobileSites(benchmark.Benchmark): return 'smoothness.sync_scroll.pathological_mobile_sites' -class SmoothnessToughAnimatedImageCases(benchmark.Benchmark): +class SmoothnessToughAnimatedImageCases(perf_benchmark.PerfBenchmark): test = smoothness.Smoothness page_set = page_sets.ToughAnimatedImageCasesPageSet diff --git a/tools/perf/benchmarks/spaceport.py b/tools/perf/benchmarks/spaceport.py index d275b7f..592743f 100644 --- a/tools/perf/benchmarks/spaceport.py +++ b/tools/perf/benchmarks/spaceport.py @@ -7,6 +7,8 @@ import logging import os +from core import perf_benchmark + from telemetry import benchmark from telemetry.core import util from telemetry import page as page_module @@ -95,7 +97,7 @@ class _SpaceportMeasurement(page_test.PageTest): # crbug.com/166703: This test frequently times out on Windows. @benchmark.Disabled('mac', 'win') -class Spaceport(benchmark.Benchmark): +class Spaceport(perf_benchmark.PerfBenchmark): """spaceport.io's PerfMarks benchmark. http://spaceport.io/community/perfmarks diff --git a/tools/perf/benchmarks/speedometer.py b/tools/perf/benchmarks/speedometer.py index f463abc..da51419 100644 --- a/tools/perf/benchmarks/speedometer.py +++ b/tools/perf/benchmarks/speedometer.py @@ -18,7 +18,8 @@ engine, CSS style resolution, layout, and other technologies. import os -from telemetry import benchmark +from core import perf_benchmark + from telemetry import page as page_module from telemetry.page import page_set from telemetry.page import page_test @@ -82,7 +83,7 @@ class SpeedometerMeasurement(page_test.PageTest): """ % suite_name), important=False)) keychain_metric.KeychainMetric().AddResults(tab, results) -class Speedometer(benchmark.Benchmark): +class Speedometer(perf_benchmark.PerfBenchmark): test = SpeedometerMeasurement @classmethod diff --git a/tools/perf/benchmarks/start_with_url.py b/tools/perf/benchmarks/start_with_url.py index 43a1798..4bf45d5 100644 --- a/tools/perf/benchmarks/start_with_url.py +++ b/tools/perf/benchmarks/start_with_url.py @@ -2,13 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import startup +from telemetry import benchmark import page_sets -class _StartWithUrl(benchmark.Benchmark): +class _StartWithUrl(perf_benchmark.PerfBenchmark): page_set = page_sets.StartupPagesPageSet test = startup.StartWithUrl diff --git a/tools/perf/benchmarks/startup.py b/tools/perf/benchmarks/startup.py index 1f53666..f862547 100644 --- a/tools/perf/benchmarks/startup.py +++ b/tools/perf/benchmarks/startup.py @@ -2,13 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import startup +from telemetry import benchmark import page_sets -class _StartupCold(benchmark.Benchmark): +class _StartupCold(perf_benchmark.PerfBenchmark): """Measures cold startup time with a clean profile.""" options = {'pageset_repeat': 5} @@ -20,7 +21,7 @@ class _StartupCold(benchmark.Benchmark): return startup.Startup(cold=True) -class _StartupWarm(benchmark.Benchmark): +class _StartupWarm(perf_benchmark.PerfBenchmark): """Measures warm startup time with a clean profile.""" options = {'pageset_repeat': 20} @@ -71,7 +72,7 @@ class StartupLargeProfileColdBlankPage(_StartupCold): super(StartupLargeProfileColdBlankPage, self).__init__(max_failures) self.generated_profile_archive = "large_profile.zip" - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): options.browser_startup_timeout = 10 * 60 @classmethod @@ -91,7 +92,7 @@ class StartupLargeProfileWarmBlankPage(_StartupWarm): super(StartupLargeProfileWarmBlankPage, self).__init__(max_failures) self.generated_profile_archive = "large_profile.zip" - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): options.browser_startup_timeout = 10 * 60 @classmethod diff --git a/tools/perf/benchmarks/sunspider.py b/tools/perf/benchmarks/sunspider.py index fcb7ebe..0263ea0 100644 --- a/tools/perf/benchmarks/sunspider.py +++ b/tools/perf/benchmarks/sunspider.py @@ -5,7 +5,8 @@ import collections import json import os -from telemetry import benchmark +from core import perf_benchmark + from telemetry import page as page_module from telemetry.page import page_set from telemetry.page import page_test @@ -125,7 +126,7 @@ class _SunspiderMeasurement(page_test.PageTest): 'in sunspider')) -class Sunspider(benchmark.Benchmark): +class Sunspider(perf_benchmark.PerfBenchmark): """Apple's SunSpider JavaScript benchmark. http://www.webkit.org/perf/sunspider/sunspider.html diff --git a/tools/perf/benchmarks/tab_switching.py b/tools/perf/benchmarks/tab_switching.py index 4d38263..3dbacf6 100644 --- a/tools/perf/benchmarks/tab_switching.py +++ b/tools/perf/benchmarks/tab_switching.py @@ -2,15 +2,16 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import tab_switching +from telemetry import benchmark import page_sets @benchmark.Enabled('has tabs') @benchmark.Disabled('android') # http://crbug.com/460084 -class TabSwitchingTop10(benchmark.Benchmark): +class TabSwitchingTop10(perf_benchmark.PerfBenchmark): """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. The histogram is a measure of the time between when a tab was requested to be @@ -28,7 +29,7 @@ class TabSwitchingTop10(benchmark.Benchmark): @benchmark.Enabled('has tabs') @benchmark.Disabled('android') # http://crbug.com/460084 -class TabSwitchingTypical25(benchmark.Benchmark): +class TabSwitchingTypical25(perf_benchmark.PerfBenchmark): """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. The histogram is a measure of the time between when a tab was requested to be @@ -48,7 +49,7 @@ class TabSwitchingTypical25(benchmark.Benchmark): @benchmark.Disabled('android') # http://crbug.com/460084 @benchmark.Enabled('has tabs') -class TabSwitchingFiveBlankTabs(benchmark.Benchmark): +class TabSwitchingFiveBlankTabs(perf_benchmark.PerfBenchmark): """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. The histogram is a measure of the time between when a tab was requested to be @@ -68,7 +69,7 @@ class TabSwitchingFiveBlankTabs(benchmark.Benchmark): @benchmark.Enabled('has tabs') # http://crbug.com/460084, http://crbug.com/488067 @benchmark.Disabled('android', 'linux') -class TabSwitchingToughEnergyCases(benchmark.Benchmark): +class TabSwitchingToughEnergyCases(perf_benchmark.PerfBenchmark): """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. The histogram is a measure of the time between when a tab was requested to be @@ -87,7 +88,7 @@ class TabSwitchingToughEnergyCases(benchmark.Benchmark): @benchmark.Enabled('has tabs') @benchmark.Disabled('android') # http://crbug.com/460084 -class TabSwitchingToughImageCases(benchmark.Benchmark): +class TabSwitchingToughImageCases(perf_benchmark.PerfBenchmark): """This test records the MPArch.RWH_TabSwitchPaintDuration histogram. The histogram is a measure of the time between when a tab was requested to be @@ -104,7 +105,7 @@ class TabSwitchingToughImageCases(benchmark.Benchmark): @benchmark.Enabled('linux', 'mac', 'win', 'chromeos') -class TabSwitchingFlashEnergyCases(benchmark.Benchmark): +class TabSwitchingFlashEnergyCases(perf_benchmark.PerfBenchmark): test = tab_switching.TabSwitching page_set = page_sets.FlashEnergyCasesPageSet options = {'pageset_repeat': 10} @@ -115,12 +116,12 @@ class TabSwitchingFlashEnergyCases(benchmark.Benchmark): @benchmark.Enabled('linux', 'mac', 'win', 'chromeos') -class TabSwitchingPluginPowerSaver(benchmark.Benchmark): +class TabSwitchingPluginPowerSaver(perf_benchmark.PerfBenchmark): test = tab_switching.TabSwitching page_set = page_sets.FlashEnergyCasesPageSet options = {'pageset_repeat': 10} - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): options.AppendExtraBrowserArgs(['--enable-plugin-power-saver']) @classmethod diff --git a/tools/perf/benchmarks/task_execution_time.py b/tools/perf/benchmarks/task_execution_time.py index 5bb38f2..79608a1 100644 --- a/tools/perf/benchmarks/task_execution_time.py +++ b/tools/perf/benchmarks/task_execution_time.py @@ -2,14 +2,15 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import task_execution_time +from telemetry import benchmark import page_sets @benchmark.Enabled('android') -class TaskExecutionTimeKeyMobileSites(benchmark.Benchmark): +class TaskExecutionTimeKeyMobileSites(perf_benchmark.PerfBenchmark): """Measures task execution statistics while scrolling down key mobile sites. @@ -25,7 +26,7 @@ class TaskExecutionTimeKeyMobileSites(benchmark.Benchmark): @benchmark.Enabled('android') -class TaskExecutionTimeToughSchedulingCases(benchmark.Benchmark): +class TaskExecutionTimeToughSchedulingCases(perf_benchmark.PerfBenchmark): """Measures task execution statistics while scrolling tough scheduling sites. @@ -41,7 +42,7 @@ class TaskExecutionTimeToughSchedulingCases(benchmark.Benchmark): @benchmark.Enabled('android') -class TaskExecutionTimePathologicalMobileSites(benchmark.Benchmark): +class TaskExecutionTimePathologicalMobileSites(perf_benchmark.PerfBenchmark): """Measures task execution statistics while scrolling pathological sites. diff --git a/tools/perf/benchmarks/thread_times.py b/tools/perf/benchmarks/thread_times.py index 812cbca..28c364e 100644 --- a/tools/perf/benchmarks/thread_times.py +++ b/tools/perf/benchmarks/thread_times.py @@ -2,13 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from benchmarks import silk_flags from measurements import thread_times +from telemetry import benchmark import page_sets -class _ThreadTimes(benchmark.Benchmark): +class _ThreadTimes(perf_benchmark.PerfBenchmark): @classmethod def AddBenchmarkCommandLineArgs(cls, parser): parser.add_option('--report-silk-details', action='store_true', @@ -78,7 +79,7 @@ class ThreadTimesCompositorCases(_ThreadTimes): http://www.chromium.org/developers/design-documents/rendering-benchmarks""" page_set = page_sets.ToughCompositorCasesPageSet - def CustomizeBrowserOptions(self, options): + def SetExtraBrowserOptions(self, options): silk_flags.CustomizeBrowserOptionsForSoftwareRasterization(options) @classmethod diff --git a/tools/perf/benchmarks/v8.py b/tools/perf/benchmarks/v8.py index 8b90855..5e76f77 100644 --- a/tools/perf/benchmarks/v8.py +++ b/tools/perf/benchmarks/v8.py @@ -2,15 +2,16 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import v8_detached_context_age_in_gc from measurements import v8_gc_times +from telemetry import benchmark import page_sets @benchmark.Disabled('win') # crbug.com/416502 -class V8GarbageCollectionCases(benchmark.Benchmark): +class V8GarbageCollectionCases(perf_benchmark.PerfBenchmark): """Measure V8 GC metrics on the garbage collection cases.""" test = v8_gc_times.V8GCTimes page_set = page_sets.GarbageCollectionCasesPageSet @@ -22,7 +23,7 @@ class V8GarbageCollectionCases(benchmark.Benchmark): # Disabled on Win due to crbug.com/416502. # TODO(rmcilroy): reenable on reference when crbug.com/456845 is fixed. @benchmark.Disabled('win', 'reference') -class V8Top25(benchmark.Benchmark): +class V8Top25(perf_benchmark.PerfBenchmark): """Measures V8 GC metrics on the while scrolling down the top 25 web pages. http://www.chromium.org/developers/design-documents/rendering-benchmarks""" @@ -34,7 +35,7 @@ class V8Top25(benchmark.Benchmark): return 'v8.top_25_smooth' @benchmark.Enabled('android') -class V8KeyMobileSites(benchmark.Benchmark): +class V8KeyMobileSites(perf_benchmark.PerfBenchmark): """Measures V8 GC metrics on the while scrolling down key mobile sites. http://www.chromium.org/developers/design-documents/rendering-benchmarks""" @@ -45,7 +46,7 @@ class V8KeyMobileSites(benchmark.Benchmark): def Name(cls): return 'v8.key_mobile_sites_smooth' -class V8DetachedContextAgeInGC(benchmark.Benchmark): +class V8DetachedContextAgeInGC(perf_benchmark.PerfBenchmark): """Measures the number of GCs needed to collect a detached context. http://www.chromium.org/developers/design-documents/rendering-benchmarks""" diff --git a/tools/perf/benchmarks/webrtc.py b/tools/perf/benchmarks/webrtc.py index ffd66d9..eb5002c 100644 --- a/tools/perf/benchmarks/webrtc.py +++ b/tools/perf/benchmarks/webrtc.py @@ -2,13 +2,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from telemetry import benchmark +from core import perf_benchmark from measurements import webrtc import page_sets -class WebRTC(benchmark.Benchmark): +class WebRTC(perf_benchmark.PerfBenchmark): """Obtains WebRTC metrics for a real-time video tests.""" test = webrtc.WebRTC page_set = page_sets.WebrtcCasesPageSet diff --git a/tools/perf/bootstrap_deps b/tools/perf/bootstrap_deps index 565c5d8..b8eefff 100644 --- a/tools/perf/bootstrap_deps +++ b/tools/perf/bootstrap_deps @@ -10,6 +10,8 @@ deps = { "src/tools/perf/benchmarks": "https://src.chromium.org/chrome/trunk/src/tools/perf/benchmarks", + "src/tools/perf/core": + "https://src.chromium.org/chrome/trunk/src/tools/perf/core", "src/tools/perf/measurements": "https://src.chromium.org/chrome/trunk/src/tools/perf/measurements", "src/tools/perf/page_sets": @@ -20,6 +22,8 @@ deps = { "https://src.chromium.org/chrome/trunk/src/tools/perf/profile_creators", "src/tools/perf/run_benchmark": "https://src.chromium.org/chrome/trunk/src/tools/perf/run_benchmark", + "src/testing/variations": + "https://src.chromium.org/chrome/trunk/src/testing/variations", } # tools/perf depends on Telemetry, so pull in the Telemetry deps, too. diff --git a/tools/perf/core/__init__.py b/tools/perf/core/__init__.py new file mode 100644 index 0000000..50b23df --- /dev/null +++ b/tools/perf/core/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. diff --git a/tools/perf/core/perf_benchmark.py b/tools/perf/core/perf_benchmark.py new file mode 100644 index 0000000..7dbaa1a --- /dev/null +++ b/tools/perf/core/perf_benchmark.py @@ -0,0 +1,48 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import sys + +from telemetry import benchmark +from telemetry.core import browser_finder + +sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir, 'variations')) +import fieldtrial_util # pylint: disable=import-error + + +class PerfBenchmark(benchmark.Benchmark): + + def SetExtraBrowserOptions(self, options): + """ To be overridden by perf benchmarks. """ + pass + + def CustomizeBrowserOptions(self, options): + # Subclass of PerfBenchmark should override SetExtraBrowserOptions to add + # more browser options rather than overriding CustomizeBrowserOptions. + super(PerfBenchmark, self).CustomizeBrowserOptions(options) + variations = self._GetVariationsBrowserArgs(options.finder_options) + options.AppendExtraBrowserArgs(variations) + self.SetExtraBrowserOptions(options) + + @staticmethod + def _FixupTargetOS(target_os): + if target_os == 'darwin': + return 'mac' + if target_os.startswith('win'): + return 'win' + if target_os.startswith('linux'): + return 'linux' + return target_os + + def _GetVariationsBrowserArgs(self, finder_options): + variations_dir = os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir, os.pardir, 'testing', 'variations') + target_os = browser_finder.FindBrowser(finder_options).target_os + base_variations_path = os.path.join(variations_dir, + 'fieldtrial_testing_config.json') + return fieldtrial_util.GenerateArgs(base_variations_path, + os.path.join(variations_dir, + 'fieldtrial_testing_config_%s.json' % self._FixupTargetOS(target_os))) |