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

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

Issue 15979032: Android: renames pylib.constants.CHROME_DIR to DIR_SOURCE_ROOT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 glob 5 import glob
6 import logging 6 import logging
7 import os 7 import os
8 8
9 from pylib import android_commands 9 from pylib import android_commands
10 from pylib import constants 10 from pylib import constants
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 'chrome/test/data/web_database', 66 'chrome/test/data/web_database',
67 'chrome/test/data/webui/', 67 'chrome/test/data/webui/',
68 'chrome/third_party/mock4js/', 68 'chrome/third_party/mock4js/',
69 'net/data/ssl/certificates', 69 'net/data/ssl/certificates',
70 'third_party/accessibility-developer-tools/gen/axs_testing.js', 70 'third_party/accessibility-developer-tools/gen/axs_testing.js',
71 'third_party/zlib/google/test/data', 71 'third_party/zlib/google/test/data',
72 ] 72 ]
73 # The following are spell check data. Now only list the data under 73 # The following are spell check data. Now only list the data under
74 # third_party/hunspell_dictionaries which are used by unit tests. 74 # third_party/hunspell_dictionaries which are used by unit tests.
75 old_cwd = os.getcwd() 75 old_cwd = os.getcwd()
76 os.chdir(constants.CHROME_DIR) 76 os.chdir(constants.DIR_SOURCE_ROOT)
77 test_files += glob.glob('third_party/hunspell_dictionaries/*.bdic') 77 test_files += glob.glob('third_party/hunspell_dictionaries/*.bdic')
78 os.chdir(old_cwd) 78 os.chdir(old_cwd)
79 return test_files 79 return test_files
80 elif test_suite_basename == 'media_unittests': 80 elif test_suite_basename == 'media_unittests':
81 return [ 81 return [
82 'media/test/data', 82 'media/test/data',
83 ] 83 ]
84 elif test_suite_basename == 'net_unittests': 84 elif test_suite_basename == 'net_unittests':
85 return [ 85 return [
86 'chrome/test/data/animate1.gif', 86 'chrome/test/data/animate1.gif',
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 test_suite, 269 test_suite,
270 timeout, 270 timeout,
271 self._cleanup_test_files, 271 self._cleanup_test_files,
272 self.tool, 272 self.tool,
273 test_apk_package_name, 273 test_apk_package_name,
274 test_activity_name, 274 test_activity_name,
275 command_line_file) 275 command_line_file)
276 else: 276 else:
277 # Put a copy into the android out/target directory, to allow stack trace 277 # Put a copy into the android out/target directory, to allow stack trace
278 # generation. 278 # generation.
279 symbols_dir = os.path.join(constants.CHROME_DIR, 'out', build_type, 279 symbols_dir = os.path.join(constants.DIR_SOURCE_ROOT, 'out', build_type,
280 'lib.target') 280 'lib.target')
281 self.test_package = test_package_executable.TestPackageExecutable( 281 self.test_package = test_package_executable.TestPackageExecutable(
282 self.adb, 282 self.adb,
283 device, 283 device,
284 test_suite, 284 test_suite,
285 timeout, 285 timeout,
286 self._cleanup_test_files, 286 self._cleanup_test_files,
287 self.tool, 287 self.tool,
288 symbols_dir) 288 symbols_dir)
289 289
(...skipping 17 matching lines...) Expand all
307 self.CopyTestData([data], self.adb.GetExternalStorage()) 307 self.CopyTestData([data], self.adb.GetExternalStorage())
308 if self.test_package.test_suite_basename == 'webkit_unit_tests': 308 if self.test_package.test_suite_basename == 'webkit_unit_tests':
309 self.PushWebKitUnitTestsData() 309 self.PushWebKitUnitTestsData()
310 310
311 def PushWebKitUnitTestsData(self): 311 def PushWebKitUnitTestsData(self):
312 """Pushes the webkit_unit_tests data files to the device. 312 """Pushes the webkit_unit_tests data files to the device.
313 313
314 The path of this directory is different when the suite is being run as 314 The path of this directory is different when the suite is being run as
315 part of a WebKit check-out. 315 part of a WebKit check-out.
316 """ 316 """
317 webkit_src = os.path.join(constants.CHROME_DIR, 'third_party', 'WebKit') 317 webkit_src = os.path.join(constants.DIR_SOURCE_ROOT, 'third_party',
318 'WebKit')
318 if self.in_webkit_checkout: 319 if self.in_webkit_checkout:
319 webkit_src = os.path.join(constants.CHROME_DIR, '..', '..', '..') 320 webkit_src = os.path.join(constants.DIR_SOURCE_ROOT, '..', '..', '..')
320 321
321 self.adb.PushIfNeeded( 322 self.adb.PushIfNeeded(
322 os.path.join(webkit_src, 'Source/WebKit/chromium/tests/data'), 323 os.path.join(webkit_src, 'Source/WebKit/chromium/tests/data'),
323 os.path.join( 324 os.path.join(
324 self.adb.GetExternalStorage(), 325 self.adb.GetExternalStorage(),
325 'third_party/WebKit/Source/WebKit/chromium/tests/data')) 326 'third_party/WebKit/Source/WebKit/chromium/tests/data'))
326 327
327 # TODO(craigdh): There is no reason for this to be part of TestRunner. 328 # TODO(craigdh): There is no reason for this to be part of TestRunner.
328 def GetDisabledTests(self): 329 def GetDisabledTests(self):
329 """Returns a list of disabled tests. 330 """Returns a list of disabled tests.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 self.LaunchChromeTestServerSpawner() 379 self.LaunchChromeTestServerSpawner()
379 self.tool.SetupEnvironment() 380 self.tool.SetupEnvironment()
380 381
381 #override 382 #override
382 def TearDown(self): 383 def TearDown(self):
383 """Cleans up the test enviroment for the test suite.""" 384 """Cleans up the test enviroment for the test suite."""
384 self.tool.CleanUpEnvironment() 385 self.tool.CleanUpEnvironment()
385 if self._cleanup_test_files: 386 if self._cleanup_test_files:
386 self.adb.RemovePushedFiles() 387 self.adb.RemovePushedFiles()
387 super(TestRunner, self).TearDown() 388 super(TestRunner, self).TearDown()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698