| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import collections | 6 import collections |
| 7 import glob | 7 import glob |
| 8 import hashlib | 8 import hashlib |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| 11 import random | 11 import random |
| 12 import re | 12 import re |
| 13 import shutil | 13 import shutil |
| 14 import sys | 14 import sys |
| 15 | 15 |
| 16 import bb_utils | 16 import bb_utils |
| 17 import bb_annotations | 17 import bb_annotations |
| 18 | 18 |
| 19 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | 19 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) |
| 20 import provision_devices | 20 import provision_devices |
| 21 from pylib import android_commands | 21 from pylib import android_commands |
| 22 from pylib import constants | 22 from pylib import constants |
| 23 from pylib.device import device_utils | 23 from pylib.device import device_utils |
| 24 from pylib.gtest import gtest_config | 24 from pylib.gtest import gtest_config |
| 25 | 25 |
| 26 CHROME_SRC_DIR = bb_utils.CHROME_SRC | 26 CHROME_SRC_DIR = bb_utils.CHROME_SRC |
| 27 DIR_BUILD_ROOT = os.path.dirname(CHROME_SRC_DIR) | 27 DIR_BUILD_ROOT = os.path.dirname(CHROME_SRC_DIR) |
| 28 CHROME_OUT_DIR = bb_utils.CHROME_OUT_DIR | 28 CHROME_OUT_DIR = bb_utils.CHROME_OUT_DIR |
| 29 BK_SCRIPTS_DIR = 'third_party/WebKit/Tools/Scripts' | 29 BLINK_SCRIPTS_DIR = 'third_party/WebKit/Tools/Scripts' |
| 30 | 30 |
| 31 SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave') | 31 SLAVE_SCRIPTS_DIR = os.path.join(bb_utils.BB_BUILD_DIR, 'scripts', 'slave') |
| 32 LOGCAT_DIR = os.path.join(bb_utils.CHROME_OUT_DIR, 'logcat') | 32 LOGCAT_DIR = os.path.join(bb_utils.CHROME_OUT_DIR, 'logcat') |
| 33 GS_URL = 'https://storage.googleapis.com' | 33 GS_URL = 'https://storage.googleapis.com' |
| 34 GS_AUTH_URL = 'https://storage.cloud.google.com' | 34 GS_AUTH_URL = 'https://storage.cloud.google.com' |
| 35 | 35 |
| 36 # Describes an instrumation test suite: | 36 # Describes an instrumation test suite: |
| 37 # test: Name of test we're running. | 37 # test: Name of test we're running. |
| 38 # apk: apk to be installed. | 38 # apk: apk to be installed. |
| 39 # apk_package: package for the apk to be installed. | 39 # apk_package: package for the apk to be installed. |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 # associated with it. | 280 # associated with it. |
| 281 args.append('--official-build') | 281 args.append('--official-build') |
| 282 | 282 |
| 283 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args, | 283 RunCmd(['build/android/test_runner.py', 'instrumentation'] + args, |
| 284 flunk_on_failure=flunk_on_failure) | 284 flunk_on_failure=flunk_on_failure) |
| 285 | 285 |
| 286 | 286 |
| 287 def RunWebkitLint(): | 287 def RunWebkitLint(): |
| 288 """Lint WebKit's TestExpectation files.""" | 288 """Lint WebKit's TestExpectation files.""" |
| 289 bb_annotations.PrintNamedStep('webkit_lint') | 289 bb_annotations.PrintNamedStep('webkit_lint') |
| 290 RunCmd([SrcPath(os.path.join(BK_SCRIPTS_DIR, 'lint-test-expectations')), | 290 RunCmd([SrcPath(os.path.join(BLINK_SCRIPTS_DIR, 'lint-test-expectations'))]) |
| 291 '--android']) | |
| 292 | 291 |
| 293 | 292 |
| 294 def RunWebkitLayoutTests(options): | 293 def RunWebkitLayoutTests(options): |
| 295 """Run layout tests on an actual device.""" | 294 """Run layout tests on an actual device.""" |
| 296 bb_annotations.PrintNamedStep('webkit_tests') | 295 bb_annotations.PrintNamedStep('webkit_tests') |
| 297 cmd_args = [ | 296 cmd_args = [ |
| 298 '--no-show-results', | 297 '--no-show-results', |
| 299 '--no-new-test-results', | 298 '--no-new-test-results', |
| 300 '--full-results-html', | 299 '--full-results-html', |
| 301 '--clobber-old-results', | 300 '--clobber-old-results', |
| (...skipping 17 matching lines...) Expand all Loading... |
| 319 cmd_args.extend( | 318 cmd_args.extend( |
| 320 ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)]) | 319 ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)]) |
| 321 | 320 |
| 322 # TODO(dpranke): Remove this block after | 321 # TODO(dpranke): Remove this block after |
| 323 # https://codereview.chromium.org/12927002/ lands. | 322 # https://codereview.chromium.org/12927002/ lands. |
| 324 for f in options.factory_properties.get('additional_expectations_files', []): | 323 for f in options.factory_properties.get('additional_expectations_files', []): |
| 325 cmd_args.extend( | 324 cmd_args.extend( |
| 326 ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)]) | 325 ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)]) |
| 327 | 326 |
| 328 exit_code = RunCmd( | 327 exit_code = RunCmd( |
| 329 [SrcPath(os.path.join(BK_SCRIPTS_DIR, 'run-webkit-tests'))] + cmd_args) | 328 [SrcPath(os.path.join(BLINK_SCRIPTS_DIR, 'run-webkit-tests'))] + cmd_args) |
| 330 if exit_code == 255: # test_run_results.UNEXPECTED_ERROR_EXIT_STATUS | 329 if exit_code == 255: # test_run_results.UNEXPECTED_ERROR_EXIT_STATUS |
| 331 bb_annotations.PrintMsg('?? (crashed or hung)') | 330 bb_annotations.PrintMsg('?? (crashed or hung)') |
| 332 elif exit_code == 254: # test_run_results.NO_DEVICES_EXIT_STATUS | 331 elif exit_code == 254: # test_run_results.NO_DEVICES_EXIT_STATUS |
| 333 bb_annotations.PrintMsg('?? (no devices found)') | 332 bb_annotations.PrintMsg('?? (no devices found)') |
| 334 elif exit_code == 253: # test_run_results.NO_TESTS_EXIT_STATUS | 333 elif exit_code == 253: # test_run_results.NO_TESTS_EXIT_STATUS |
| 335 bb_annotations.PrintMsg('?? (no tests found)') | 334 bb_annotations.PrintMsg('?? (no tests found)') |
| 336 else: | 335 else: |
| 337 full_results_path = os.path.join('..', 'layout-test-results', | 336 full_results_path = os.path.join('..', 'layout-test-results', |
| 338 'full_results.json') | 337 'full_results.json') |
| 339 if os.path.exists(full_results_path): | 338 if os.path.exists(full_results_path): |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 | 732 |
| 734 if options.coverage_bucket: | 733 if options.coverage_bucket: |
| 735 setattr(options, 'coverage_dir', | 734 setattr(options, 'coverage_dir', |
| 736 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 735 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
| 737 | 736 |
| 738 MainTestWrapper(options) | 737 MainTestWrapper(options) |
| 739 | 738 |
| 740 | 739 |
| 741 if __name__ == '__main__': | 740 if __name__ == '__main__': |
| 742 sys.exit(main(sys.argv)) | 741 sys.exit(main(sys.argv)) |
| OLD | NEW |