2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
17 filter_tests
= json
.load(args
.filter_file
)
19 test_args
= ['--retry-limit', '3']
20 if 'android' == args
.properties
.get('target_platform'):
21 test_args
+= ['--browser', 'android-chromium', '--device', 'android']
23 test_args
+= ['--browser', args
.build_config_fs
.lower()]
25 with common
.temporary_file() as tempfile_path
:
26 test_args
+= ['--write-full-results-to', tempfile_path
]
27 rc
= common
.run_runtest(args
, [
28 '--test-type', 'telemetry_perf_unittests',
29 '--run-python-script',
30 os
.path
.join(common
.SRC_DIR
, 'tools', 'perf', 'run_tests')
31 ] + test_args
+ filter_tests
)
33 with
open(tempfile_path
) as f
:
34 results
= json
.load(f
)
36 parsed_results
= common
.parse_common_test_results(results
, test_separator
='.')
37 failures
= parsed_results
['unexpected_failures']
40 'valid': bool(rc
<= common
.MAX_FAILURES_EXIT_STATUS
and
41 ((rc
== 0) or failures
)),
42 'failures': failures
.keys(),
48 def main_compile_targets(args
):
49 if 'android' == args
.properties
.get('target_platform'):
50 json
.dump(['chrome_public_apk'], args
.output
)
52 json
.dump(['chrome'], args
.output
)
55 if __name__
== '__main__':
58 'compile_targets': main_compile_targets
,
60 sys
.exit(common
.run_script(sys
.argv
[1:], funcs
))