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

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

Issue 19040002: [Android] Convert more test targets to use isolate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 7
8 from pylib import android_commands 8 from pylib import android_commands
9 from pylib import constants 9 from pylib import constants
10 from pylib.android_commands import errors 10 from pylib.android_commands import errors
(...skipping 12 matching lines...) Expand all
23 23
24 Args: 24 Args:
25 test_suite_basename: The test suite basename (e.g. base_unittests). 25 test_suite_basename: The test suite basename (e.g. base_unittests).
26 26
27 Returns: 27 Returns:
28 A list of test file and directory paths. 28 A list of test file and directory paths.
29 """ 29 """
30 # Ideally, we'd just push all test data. However, it has >100MB, and a lot 30 # Ideally, we'd just push all test data. However, it has >100MB, and a lot
31 # of the files are not relevant (some are used for browser_tests, others for 31 # of the files are not relevant (some are used for browser_tests, others for
32 # features not supported, etc..). 32 # features not supported, etc..).
33 if test_suite_basename == 'media_unittests': 33 if test_suite_basename == 'modules_unittests':
34 return [
35 'media/test/data',
36 ]
37 elif test_suite_basename == 'net_unittests':
38 return [
39 'chrome/test/data/animate1.gif',
40 'chrome/test/data/simple.html',
41 'net/data/cache_tests',
42 'net/data/filter_unittests',
43 'net/data/ftp',
44 'net/data/proxy_resolver_v8_tracing_unittest',
45 'net/data/proxy_resolver_v8_unittest',
46 'net/data/proxy_script_fetcher_unittest',
47 'net/data/ssl/certificates',
48 'net/data/test.html',
49 'net/data/url_request_unittest/',
50 ]
51 elif test_suite_basename == 'ui_tests':
52 return [
53 'chrome/test/data/dromaeo',
54 'chrome/test/data/json2.js',
55 'chrome/test/data/sunspider',
56 ]
57 elif test_suite_basename == 'ui_unittests':
58 return [
59 'ui/base/test/data/data_pack_unittest/truncated-header.pak',
60 ]
61 elif test_suite_basename == 'content_unittests':
62 return [
63 'content/test/data/gpu/webgl_conformance_test_expectations.txt',
64 'content/test/data/page_state/',
65 'net/data/ssl/certificates/',
66 'third_party/hyphen/hyph_en_US.dic',
67 'webkit/data/dom_storage/webcore_test_database.localstorage',
68 ]
69 elif test_suite_basename == 'cc_perftests':
70 return [
71 'cc/test/data',
72 ]
73 elif test_suite_basename == 'perf_tests':
74 return [
75 'base/test/data',
76 ]
77 elif test_suite_basename == 'content_browsertests':
78 return [
79 'content/test/data/content-disposition-inline.html',
80 'content/test/data/title1.html',
81 'content/test/data/post_message2.html',
82 'content/test/data/content-sniffer-test0.html.mock-http-headers',
83 'content/test/data/content-sniffer-test1.html.mock-http-headers',
84 'content/test/data/speech',
85 'content/test/data/page404.html.mock-http-headers',
86 'content/test/data/content-sniffer-test3.html',
87 'content/test/data/post_message.html',
88 'content/test/data/remove_frame_on_unload.html',
89 'content/test/data/cross-origin-redirect-blocked.html',
90 'content/test/data/prerender',
91 'content/test/data/device_orientation',
92 'content/test/data/content-disposition-empty.html',
93 'content/test/data/workers',
94 'content/test/data/content-sniffer-test3.html.mock-http-headers',
95 'content/test/data/content-sniffer-test0.html',
96 'content/test/data/browser_plugin_title_change.html',
97 'content/test/data/android',
98 'content/test/data/page404.html',
99 'content/test/data/dynamic2.html',
100 'content/test/data/browser_plugin_embedder.html',
101 'content/test/data/indexeddb',
102 'content/test/data/content-disposition-inline.html.mock-http-headers',
103 'content/test/data/nosniff-test.html',
104 'content/test/data/title3.html',
105 'content/test/data/browser_plugin_post_message_guest.html',
106 'content/test/data/content-disposition-empty.html.mock-http-headers',
107 'content/test/data/session_history',
108 'content/test/data/browser_plugin_embedder.html',
109 'content/test/data/overscroll_navigation.html',
110 'content/test/data/simple_database.html',
111 'content/test/data/gtk_key_bindings_test_gtkrc',
112 'content/test/data/browser_plugin_embedder_guest_unresponsive.html',
113 'content/test/data/sync_xmlhttprequest.html',
114 'content/test/data/content-sniffer-test3-frame.txt.mock-http-headers',
115 'content/test/data/frame_tree',
116 'content/test/data/content-sniffer-test2.html.mock-http-headers',
117 'content/test/data/sync_xmlhttprequest_disallowed.html',
118 'content/test/data/rwh_simple.html',
119 'content/test/data/title2.html',
120 'content/test/data/webkit',
121 'content/test/data/content-sniffer-test1.html',
122 'content/test/data/download',
123 'content/test/data/content-sniffer-test2.html',
124 'content/test/data/simple_page.html',
125 'content/test/data/google.mht',
126 'content/test/data/site_per_process_main.html',
127 'content/test/data/gpu',
128 'content/test/data/onunload_cookie.html',
129 'content/test/data/textinput',
130 'content/test/data/navigate_opener.html',
131 'content/test/data/dom_storage',
132 'content/test/data/sync_xmlhttprequest_during_unload.html',
133 'content/test/data/browser_plugin_dragging.html',
134 'content/test/data/fileapi',
135 'content/test/data/npapi',
136 'content/test/data/nosniff-test.html.mock-http-headers',
137 'content/test/data/accessibility',
138 'content/test/data/dynamic1.html',
139 'content/test/data/browser_plugin_focus_child.html',
140 'content/test/data/rwhv_compositing_animation.html',
141 'content/test/data/click-noreferrer-links.html',
142 'content/test/data/browser_plugin_focus.html',
143 'content/test/data/media',
144 'third_party/webgl_conformance',
145 ]
146 elif test_suite_basename == 'modules_unittests':
147 return [ 34 return [
148 'resources', 35 'resources',
149 'data', 36 'data',
150 ] 37 ]
151 return [] 38 return []
152 39
153 40
154 def _TestSuiteRequiresMockTestServer(test_suite_basename): 41 def _TestSuiteRequiresMockTestServer(test_suite_basename):
155 """Returns True if the test suite requires mock test server.""" 42 """Returns True if the test suite requires mock test server."""
156 tests_require_net_test_server = ['unit_tests', 'net_unittests', 43 tests_require_net_test_server = ['unit_tests', 'net_unittests',
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 self.tool, 103 self.tool,
217 symbols_dir) 104 symbols_dir)
218 105
219 #override 106 #override
220 def InstallTestPackage(self): 107 def InstallTestPackage(self):
221 self.test_package.StripAndCopyExecutable() 108 self.test_package.StripAndCopyExecutable()
222 109
223 #override 110 #override
224 def PushDataDeps(self): 111 def PushDataDeps(self):
225 self.adb.WaitForSdCardReady(20) 112 self.adb.WaitForSdCardReady(20)
226 self.test_package.PushDataAndPakFiles()
227 self.tool.CopyFiles() 113 self.tool.CopyFiles()
228 if self.test_package.test_suite_basename == 'webkit_unit_tests': 114 if self.test_package.test_suite_basename == 'webkit_unit_tests':
229 self.PushWebKitUnitTestsData() 115 self.PushWebKitUnitTestsData()
230 return 116 return
231 117
232 if not self._deps_dir: 118 if not self._deps_dir:
233 logging.info('Did not find an isolate file for the test suite.') 119 logging.info('Did not find an isolate file for the test suite.')
234 for p in _GetDataFilesForTestSuite(self.test_package.test_suite_basename): 120 for p in _GetDataFilesForTestSuite(self.test_package.test_suite_basename):
235 self.adb.PushIfNeeded( 121 self.adb.PushIfNeeded(
236 os.path.join(constants.DIR_SOURCE_ROOT, p), 122 os.path.join(constants.DIR_SOURCE_ROOT, p),
237 os.path.join(self.adb.GetExternalStorage(), p)) 123 os.path.join(self.adb.GetExternalStorage(), p))
238 return 124 return
239 125
126 device_dir = self.adb.GetExternalStorage()
127 # TODO(frankf): linux_dumper_unittest_helper needs to be in the same dir
128 # as breakpad_unittests exe. Find a better way to do this.
129 if self.test_package.test_suite_basename == 'breakpad_unittests':
130 device_dir = constants.TEST_EXECUTABLE_DIR
240 for p in os.listdir(self._deps_dir): 131 for p in os.listdir(self._deps_dir):
241 self.adb.PushIfNeeded( 132 self.adb.PushIfNeeded(
242 os.path.join(self._deps_dir, p), 133 os.path.join(self._deps_dir, p),
243 os.path.join(self.adb.GetExternalStorage(), p)) 134 os.path.join(device_dir, p))
244 135
245 def PushWebKitUnitTestsData(self): 136 def PushWebKitUnitTestsData(self):
246 """Pushes the webkit_unit_tests data files to the device. 137 """Pushes the webkit_unit_tests data files to the device.
247 138
248 The path of this directory is different when the suite is being run as 139 The path of this directory is different when the suite is being run as
249 part of a WebKit check-out. 140 part of a WebKit check-out.
250 """ 141 """
251 webkit_src = os.path.join(constants.DIR_SOURCE_ROOT, 'third_party', 142 webkit_src = os.path.join(constants.DIR_SOURCE_ROOT, 'third_party',
252 'WebKit') 143 'WebKit')
253 if self.in_webkit_checkout: 144 if self.in_webkit_checkout:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 self.LaunchChromeTestServerSpawner() 204 self.LaunchChromeTestServerSpawner()
314 self.tool.SetupEnvironment() 205 self.tool.SetupEnvironment()
315 206
316 #override 207 #override
317 def TearDown(self): 208 def TearDown(self):
318 """Cleans up the test enviroment for the test suite.""" 209 """Cleans up the test enviroment for the test suite."""
319 self.tool.CleanUpEnvironment() 210 self.tool.CleanUpEnvironment()
320 if self._cleanup_test_files: 211 if self._cleanup_test_files:
321 self.adb.RemovePushedFiles() 212 self.adb.RemovePushedFiles()
322 super(TestRunner, self).TearDown() 213 super(TestRunner, self).TearDown()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698