Commit 3d449e8c authored by nednguyen's avatar nednguyen Committed by Commit bot

Add the local blink_perf benchmark that supports running any subdir of WebKit/PerformanceTest

This tries to mimic the current commandline opion of
./third_party/WebKit/Tools/Scripts/run-perf-tests. i.e: user now can run
test case in WebKit/PerformanceTests/.. directory using the command:

./tools/perf/run_benchmark blink_perf --test-path=<path to test cases>

For examples, after this CL, users can invoke:
* './tools/perf/run_benchmark blink_perf --test-path=third_party/WebKit/PerformanceTests/TestData/color-changes-measure-frame-time.html'
command to run only color-changes-measure-frame-time.html test.

* './tools/perf/run_benchmark blink_perf --test-path=TestData/'
command to run all the tests in WebKit/PerformanceTests/TestData/ directory.

This is a lot more convenient for users who are wanting to add new test cases in
directories that aren't already covered by existing blink_perf.* benchmarks.

This benchmark is added to tools/perf/contrib/ directory because it isn't meant
to be scheduled on the perf waterfall.

BUG=720772

Review-Url: https://codereview.chromium.org/2874653002
Cr-Commit-Position: refs/heads/master@{#471028}
parent 4d1357d6
# Copyright 2017 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
from benchmarks import blink_perf
# pylint: disable=protected-access
class BlinkPerfAll(blink_perf._BlinkPerfBenchmark):
@classmethod
def Name(cls):
return 'blink_perf'
@classmethod
def AddBenchmarkCommandLineArgs(cls, parser):
parser.add_option('--test-path', type='string',
default=blink_perf.BLINK_PERF_BASE_DIR,
help=('Path to blink perf tests. Could be an absolute '
'path, a relative path with respect to your '
'current directory, or a relative path with '
'respect to third_party/WebKit/PerformanceTest/)'))
def CreateStorySet(self, options):
if os.path.exists(options.test_path):
path = os.path.abspath(options.test_path)
else:
path = os.path.join(blink_perf.BLINK_PERF_BASE_DIR, options.test_path)
print
print 'Running all tests in %s' % path
return blink_perf.CreateStorySetFromPath(path, blink_perf.SKIPPED_FILE)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment