| Index: testing/scripts/headless_python_unittests.py
|
| diff --git a/testing/scripts/telemetry_gpu_unittests.py b/testing/scripts/headless_python_unittests.py
|
| similarity index 60%
|
| copy from testing/scripts/telemetry_gpu_unittests.py
|
| copy to testing/scripts/headless_python_unittests.py
|
| index cf9862e3e2405481f0bace2ed98ebf262dcfb334..8df9db06357b7658ce7a731c07971d77520d070a 100755
|
| --- a/testing/scripts/telemetry_gpu_unittests.py
|
| +++ b/testing/scripts/headless_python_unittests.py
|
| @@ -1,5 +1,5 @@
|
| #!/usr/bin/env python
|
| -# Copyright 2015 The Chromium Authors. All rights reserved.
|
| +# Copyright 2016 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.
|
|
|
| @@ -12,19 +12,19 @@ import common
|
|
|
|
|
| def main_run(args):
|
| - filter_tests = []
|
| - if args.filter_file:
|
| - filter_tests = json.load(args.filter_file)
|
| + typ_path = os.path.abspath(os.path.join(
|
| + os.path.dirname(__file__), os.path.pardir, os.path.pardir,
|
| + 'third_party', 'typ'))
|
| + _AddToPathIfNeeded(typ_path)
|
| + import typ
|
|
|
| + top_level_dir = os.path.join(common.SRC_DIR, 'headless', 'lib', 'browser')
|
| with common.temporary_file() as tempfile_path:
|
| - rc = common.run_runtest(args, [
|
| - '--test-type', 'telemetry_gpu_unittests',
|
| - '--run-python-script',
|
| - os.path.join(common.SRC_DIR,
|
| - 'content', 'test', 'gpu', 'run_unittests.py'),
|
| - '--retry-limit', '3',
|
| - '--write-full-results-to', tempfile_path,
|
| - ] + filter_tests)
|
| + rc = typ.main(
|
| + argv=[],
|
| + top_level_dir=top_level_dir,
|
| + write_full_results_to=tempfile_path,
|
| + coverage_source=[top_level_dir])
|
|
|
| with open(tempfile_path) as f:
|
| results = json.load(f)
|
| @@ -45,6 +45,11 @@ def main_compile_targets(args):
|
| json.dump([], args.output)
|
|
|
|
|
| +def _AddToPathIfNeeded(path):
|
| + if path not in sys.path:
|
| + sys.path.insert(0, path)
|
| +
|
| +
|
| if __name__ == '__main__':
|
| funcs = {
|
| 'run': main_run,
|
|
|