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 devil_chromium |
20 import provision_devices | 21 import provision_devices |
21 from devil.android import device_utils | 22 from devil.android import device_utils |
22 from pylib import constants | 23 from pylib import constants |
23 from pylib.gtest import gtest_config | 24 from pylib.gtest import gtest_config |
24 | 25 |
25 CHROME_SRC_DIR = bb_utils.CHROME_SRC | 26 CHROME_SRC_DIR = bb_utils.CHROME_SRC |
26 DIR_BUILD_ROOT = os.path.dirname(CHROME_SRC_DIR) | 27 DIR_BUILD_ROOT = os.path.dirname(CHROME_SRC_DIR) |
27 CHROME_OUT_DIR = bb_utils.CHROME_OUT_DIR | 28 CHROME_OUT_DIR = bb_utils.CHROME_OUT_DIR |
28 BLINK_SCRIPTS_DIR = 'third_party/WebKit/Tools/Scripts' | 29 BLINK_SCRIPTS_DIR = 'third_party/WebKit/Tools/Scripts' |
29 | 30 |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 help='Run stack tool for ASAN') | 736 help='Run stack tool for ASAN') |
736 parser.add_option('--cleanup', action='store_true', | 737 parser.add_option('--cleanup', action='store_true', |
737 help='Delete out/<target> directory at the end of the run.') | 738 help='Delete out/<target> directory at the end of the run.') |
738 return parser | 739 return parser |
739 | 740 |
740 | 741 |
741 def main(argv): | 742 def main(argv): |
742 parser = GetDeviceStepsOptParser() | 743 parser = GetDeviceStepsOptParser() |
743 options, args = parser.parse_args(argv[1:]) | 744 options, args = parser.parse_args(argv[1:]) |
744 | 745 |
| 746 devil_chromium.Initialize() |
| 747 |
745 if args: | 748 if args: |
746 return sys.exit('Unused args %s' % args) | 749 return sys.exit('Unused args %s' % args) |
747 | 750 |
748 unknown_tests = set(options.test_filter) - VALID_TESTS | 751 unknown_tests = set(options.test_filter) - VALID_TESTS |
749 if unknown_tests: | 752 if unknown_tests: |
750 return sys.exit('Unknown tests %s' % list(unknown_tests)) | 753 return sys.exit('Unknown tests %s' % list(unknown_tests)) |
751 | 754 |
752 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 755 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
753 | 756 |
754 # pylint: disable=global-statement | 757 # pylint: disable=global-statement |
755 if options.chrome_output_dir: | 758 if options.chrome_output_dir: |
756 global CHROME_OUT_DIR | 759 global CHROME_OUT_DIR |
757 global LOGCAT_DIR | 760 global LOGCAT_DIR |
758 CHROME_OUT_DIR = options.chrome_output_dir | 761 CHROME_OUT_DIR = options.chrome_output_dir |
759 LOGCAT_DIR = os.path.join(CHROME_OUT_DIR, 'logcat') | 762 LOGCAT_DIR = os.path.join(CHROME_OUT_DIR, 'logcat') |
760 | 763 |
761 if options.coverage_bucket: | 764 if options.coverage_bucket: |
762 setattr(options, 'coverage_dir', | 765 setattr(options, 'coverage_dir', |
763 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 766 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
764 | 767 |
765 MainTestWrapper(options) | 768 MainTestWrapper(options) |
766 | 769 |
767 | 770 |
768 if __name__ == '__main__': | 771 if __name__ == '__main__': |
769 sys.exit(main(sys.argv)) | 772 sys.exit(main(sys.argv)) |
OLD | NEW |