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

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

Issue 2322503005: [Android] Remove support for default isolates in the test runner. (Closed)
Patch Set: rebase Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 tempfile 8 import tempfile
9 9
10 from devil.android import apk_helper 10 from devil.android import apk_helper
11 from pylib import constants 11 from pylib import constants
12 from pylib.constants import host_paths 12 from pylib.constants import host_paths
13 from pylib.base import base_test_result 13 from pylib.base import base_test_result
14 from pylib.base import test_instance 14 from pylib.base import test_instance
15 from pylib.utils import isolator 15 from pylib.utils import isolator
16 16
17 with host_paths.SysPath(host_paths.BUILD_COMMON_PATH): 17 with host_paths.SysPath(host_paths.BUILD_COMMON_PATH):
18 import unittest_util # pylint: disable=import-error 18 import unittest_util # pylint: disable=import-error
19 19
20 20
21 BROWSER_TEST_SUITES = [ 21 BROWSER_TEST_SUITES = [
22 'components_browsertests', 22 'components_browsertests',
23 'content_browsertests', 23 'content_browsertests',
24 ] 24 ]
25 25
26 RUN_IN_SUB_THREAD_TEST_SUITES = ['net_unittests'] 26 RUN_IN_SUB_THREAD_TEST_SUITES = ['net_unittests']
27 27
28 28
29 _DEFAULT_ISOLATE_FILE_PATHS = {
30 'base_unittests': 'base/base_unittests.isolate',
31 'blink_heap_unittests':
32 'third_party/WebKit/Source/platform/heap/BlinkHeapUnitTests.isolate',
33 'blink_platform_unittests':
34 'third_party/WebKit/Source/platform/blink_platform_unittests.isolate',
35 'cc_perftests': 'cc/cc_perftests.isolate',
36 'components_browsertests': 'components/components_browsertests.isolate',
37 'components_unittests': 'components/components_unittests.isolate',
38 'content_browsertests': 'content/content_browsertests.isolate',
39 'content_unittests': 'content/content_unittests.isolate',
40 'media_perftests': 'media/media_perftests.isolate',
41 'media_unittests': 'media/media_unittests.isolate',
42 'midi_unittests': 'media/midi/midi_unittests.isolate',
43 'net_unittests': 'net/net_unittests.isolate',
44 'sql_unittests': 'sql/sql_unittests.isolate',
45 'ui_base_unittests': 'ui/base/ui_base_tests.isolate',
46 'unit_tests': 'chrome/unit_tests.isolate',
47 'webkit_unit_tests':
48 'third_party/WebKit/Source/web/WebKitUnitTests.isolate',
49 }
50
51
52 # Used for filtering large data deps at a finer grain than what's allowed in 29 # Used for filtering large data deps at a finer grain than what's allowed in
53 # isolate files since pushing deps to devices is expensive. 30 # isolate files since pushing deps to devices is expensive.
54 # Wildcards are allowed. 31 # Wildcards are allowed.
55 _DEPS_EXCLUSION_LIST = [ 32 _DEPS_EXCLUSION_LIST = [
56 'chrome/test/data/extensions/api_test', 33 'chrome/test/data/extensions/api_test',
57 'chrome/test/data/extensions/secure_shell', 34 'chrome/test/data/extensions/secure_shell',
58 'chrome/test/data/firefox*', 35 'chrome/test/data/firefox*',
59 'chrome/test/data/gpu', 36 'chrome/test/data/gpu',
60 'chrome/test/data/image_decoding', 37 'chrome/test/data/image_decoding',
61 'chrome/test/data/import', 38 'chrome/test/data/import',
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 220
244 self._data_deps = [] 221 self._data_deps = []
245 if args.test_filter: 222 if args.test_filter:
246 self._gtest_filter = args.test_filter 223 self._gtest_filter = args.test_filter
247 elif args.test_filter_file: 224 elif args.test_filter_file:
248 with open(args.test_filter_file, 'r') as f: 225 with open(args.test_filter_file, 'r') as f:
249 self._gtest_filter = ':'.join(l.strip() for l in f) 226 self._gtest_filter = ':'.join(l.strip() for l in f)
250 else: 227 else:
251 self._gtest_filter = None 228 self._gtest_filter = None
252 229
253 if not args.isolate_file_path:
254 default_isolate_file_path = _DEFAULT_ISOLATE_FILE_PATHS.get(self._suite)
255 if default_isolate_file_path:
256 args.isolate_file_path = os.path.join(
257 host_paths.DIR_SOURCE_ROOT, default_isolate_file_path)
258
259 if (args.isolate_file_path and 230 if (args.isolate_file_path and
260 not isolator.IsIsolateEmpty(args.isolate_file_path)): 231 not isolator.IsIsolateEmpty(args.isolate_file_path)):
261 self._isolate_abs_path = os.path.abspath(args.isolate_file_path) 232 self._isolate_abs_path = os.path.abspath(args.isolate_file_path)
262 self._isolate_delegate = isolate_delegate 233 self._isolate_delegate = isolate_delegate
263 self._isolated_abs_path = os.path.join( 234 self._isolated_abs_path = os.path.join(
264 constants.GetOutDirectory(), '%s.isolated' % self._suite) 235 constants.GetOutDirectory(), '%s.isolated' % self._suite)
265 else: 236 else:
266 logging.warning('%s isolate file provided. No data deps will be pushed.', 237 logging.warning('%s isolate file provided. No data deps will be pushed.',
267 'Empty' if args.isolate_file_path else 'No') 238 'Empty' if args.isolate_file_path else 'No')
268 self._isolate_delegate = None 239 self._isolate_delegate = None
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 if l and not l.startswith('#')] 381 if l and not l.startswith('#')]
411 382
412 return '*-%s' % ':'.join(disabled_filter_items) 383 return '*-%s' % ':'.join(disabled_filter_items)
413 384
414 #override 385 #override
415 def TearDown(self): 386 def TearDown(self):
416 """Clear the mappings created by SetUp.""" 387 """Clear the mappings created by SetUp."""
417 if self._isolate_delegate: 388 if self._isolate_delegate:
418 self._isolate_delegate.Clear() 389 self._isolate_delegate.Clear()
419 390
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698