OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging | 5 import logging |
6 import os | 6 import os |
7 import re | 7 import re |
8 import shutil | 8 import shutil |
9 import sys | 9 import sys |
10 | 10 |
11 from pylib import constants | 11 from pylib import constants |
12 from pylib.base import base_test_result | 12 from pylib.base import base_test_result |
13 from pylib.base import test_instance | 13 from pylib.base import test_instance |
14 | 14 |
15 sys.path.append(os.path.join( | 15 sys.path.append(os.path.join( |
16 constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) | 16 constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common')) |
17 import unittest_util | 17 import unittest_util |
18 | 18 |
19 | 19 |
| 20 BROWSER_TEST_SUITES = [ |
| 21 'components_browsertests', |
| 22 'content_browsertests', |
| 23 ] |
| 24 |
| 25 |
20 # Used for filtering large data deps at a finer grain than what's allowed in | 26 # Used for filtering large data deps at a finer grain than what's allowed in |
21 # isolate files since pushing deps to devices is expensive. | 27 # isolate files since pushing deps to devices is expensive. |
22 # Wildcards are allowed. | 28 # Wildcards are allowed. |
23 _DEPS_EXCLUSION_LIST = [ | 29 _DEPS_EXCLUSION_LIST = [ |
24 'chrome/test/data/extensions/api_test', | 30 'chrome/test/data/extensions/api_test', |
25 'chrome/test/data/extensions/secure_shell', | 31 'chrome/test/data/extensions/secure_shell', |
26 'chrome/test/data/firefox*', | 32 'chrome/test/data/firefox*', |
27 'chrome/test/data/gpu', | 33 'chrome/test/data/gpu', |
28 'chrome/test/data/image_decoding', | 34 'chrome/test/data/image_decoding', |
29 'chrome/test/data/import', | 35 'chrome/test/data/import', |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 91 |
86 class GtestTestInstance(test_instance.TestInstance): | 92 class GtestTestInstance(test_instance.TestInstance): |
87 | 93 |
88 def __init__(self, args, isolate_delegate, error_func): | 94 def __init__(self, args, isolate_delegate, error_func): |
89 super(GtestTestInstance, self).__init__() | 95 super(GtestTestInstance, self).__init__() |
90 # TODO(jbudorick): Support multiple test suites. | 96 # TODO(jbudorick): Support multiple test suites. |
91 if len(args.suite_name) > 1: | 97 if len(args.suite_name) > 1: |
92 raise ValueError('Platform mode currently supports only 1 gtest suite') | 98 raise ValueError('Platform mode currently supports only 1 gtest suite') |
93 self._suite = args.suite_name[0] | 99 self._suite = args.suite_name[0] |
94 | 100 |
95 if (self._suite == 'content_browsertests' or | 101 self._apk_path = os.path.join( |
96 self._suite == 'components_browsertests'): | 102 constants.GetOutDirectory(), '%s_apk' % self._suite, |
97 error_func('%s are not currently supported ' | 103 '%s-debug.apk' % self._suite) |
98 'in platform mode.' % self._suite) | |
99 self._apk_path = os.path.join( | |
100 constants.GetOutDirectory(), 'apks', '%s.apk' % self._suite) | |
101 else: | |
102 self._apk_path = os.path.join( | |
103 constants.GetOutDirectory(), '%s_apk' % self._suite, | |
104 '%s-debug.apk' % self._suite) | |
105 self._exe_path = os.path.join(constants.GetOutDirectory(), | 104 self._exe_path = os.path.join(constants.GetOutDirectory(), |
106 self._suite) | 105 self._suite) |
107 if not os.path.exists(self._apk_path): | 106 if not os.path.exists(self._apk_path): |
108 self._apk_path = None | 107 self._apk_path = None |
109 if not os.path.exists(self._exe_path): | 108 if not os.path.exists(self._exe_path): |
110 self._exe_path = None | 109 self._exe_path = None |
111 if not self._apk_path and not self._exe_path: | 110 if not self._apk_path and not self._exe_path: |
112 error_func('Could not find apk or executable for %s' % self._suite) | 111 error_func('Could not find apk or executable for %s' % self._suite) |
113 | 112 |
114 self._data_deps = [] | 113 self._data_deps = [] |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 return self._apk_path | 232 return self._apk_path |
234 | 233 |
235 @property | 234 @property |
236 def exe(self): | 235 def exe(self): |
237 return self._exe_path | 236 return self._exe_path |
238 | 237 |
239 @property | 238 @property |
240 def suite(self): | 239 def suite(self): |
241 return self._suite | 240 return self._suite |
242 | 241 |
OLD | NEW |