Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: build/android/pylib/gtest/gtest_test_instance.py

Issue 1138993009: Revert of [Android] Refactor the native test wrappers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
26 # Used for filtering large data deps at a finer grain than what's allowed in 20 # Used for filtering large data deps at a finer grain than what's allowed in
27 # isolate files since pushing deps to devices is expensive. 21 # isolate files since pushing deps to devices is expensive.
28 # Wildcards are allowed. 22 # Wildcards are allowed.
29 _DEPS_EXCLUSION_LIST = [ 23 _DEPS_EXCLUSION_LIST = [
30 'chrome/test/data/extensions/api_test', 24 'chrome/test/data/extensions/api_test',
31 'chrome/test/data/extensions/secure_shell', 25 'chrome/test/data/extensions/secure_shell',
32 'chrome/test/data/firefox*', 26 'chrome/test/data/firefox*',
33 'chrome/test/data/gpu', 27 'chrome/test/data/gpu',
34 'chrome/test/data/image_decoding', 28 'chrome/test/data/image_decoding',
35 'chrome/test/data/import', 29 'chrome/test/data/import',
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 85
92 class GtestTestInstance(test_instance.TestInstance): 86 class GtestTestInstance(test_instance.TestInstance):
93 87
94 def __init__(self, args, isolate_delegate, error_func): 88 def __init__(self, args, isolate_delegate, error_func):
95 super(GtestTestInstance, self).__init__() 89 super(GtestTestInstance, self).__init__()
96 # TODO(jbudorick): Support multiple test suites. 90 # TODO(jbudorick): Support multiple test suites.
97 if len(args.suite_name) > 1: 91 if len(args.suite_name) > 1:
98 raise ValueError('Platform mode currently supports only 1 gtest suite') 92 raise ValueError('Platform mode currently supports only 1 gtest suite')
99 self._suite = args.suite_name[0] 93 self._suite = args.suite_name[0]
100 94
101 self._apk_path = os.path.join( 95 if (self._suite == 'content_browsertests' or
102 constants.GetOutDirectory(), '%s_apk' % self._suite, 96 self._suite == 'components_browsertests'):
103 '%s-debug.apk' % self._suite) 97 error_func('%s are not currently supported '
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)
104 self._exe_path = os.path.join(constants.GetOutDirectory(), 105 self._exe_path = os.path.join(constants.GetOutDirectory(),
105 self._suite) 106 self._suite)
106 if not os.path.exists(self._apk_path): 107 if not os.path.exists(self._apk_path):
107 self._apk_path = None 108 self._apk_path = None
108 if not os.path.exists(self._exe_path): 109 if not os.path.exists(self._exe_path):
109 self._exe_path = None 110 self._exe_path = None
110 if not self._apk_path and not self._exe_path: 111 if not self._apk_path and not self._exe_path:
111 error_func('Could not find apk or executable for %s' % self._suite) 112 error_func('Could not find apk or executable for %s' % self._suite)
112 113
113 self._data_deps = [] 114 self._data_deps = []
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 return self._apk_path 233 return self._apk_path
233 234
234 @property 235 @property
235 def exe(self): 236 def exe(self):
236 return self._exe_path 237 return self._exe_path
237 238
238 @property 239 @property
239 def suite(self): 240 def suite(self):
240 return self._suite 241 return self._suite
241 242
OLDNEW
« no previous file with comments | « build/android/pylib/constants/__init__.py ('k') | build/android/pylib/gtest/local_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698