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

Side by Side Diff: trunk/src/build/android/pylib/gtest/test_package_apk.py

Issue 23926012: Revert 221736 "[android] Adds constants.GetOutDirectory() and co..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 | 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 """Defines TestPackageApk to help run APK-based native tests.""" 5 """Defines TestPackageApk to help run APK-based native tests."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import shlex 9 import shlex
10 import sys 10 import sys
(...skipping 11 matching lines...) Expand all
22 22
23 class TestPackageApk(TestPackage): 23 class TestPackageApk(TestPackage):
24 """A helper class for running APK-based native tests.""" 24 """A helper class for running APK-based native tests."""
25 25
26 def __init__(self, suite_name): 26 def __init__(self, suite_name):
27 """ 27 """
28 Args: 28 Args:
29 suite_name: Name of the test suite (e.g. base_unittests). 29 suite_name: Name of the test suite (e.g. base_unittests).
30 """ 30 """
31 TestPackage.__init__(self, suite_name) 31 TestPackage.__init__(self, suite_name)
32 product_dir = os.path.join(cmd_helper.OutDirectory.get(),
33 constants.GetBuildType())
32 if suite_name == 'content_browsertests': 34 if suite_name == 'content_browsertests':
33 self.suite_path = os.path.join( 35 self.suite_path = os.path.join(
34 constants.GetOutDirectory(), 'apks', '%s.apk' % suite_name) 36 product_dir, 'apks', '%s.apk' % suite_name)
35 self._package_info = constants.PACKAGE_INFO['content_browsertests'] 37 self._package_info = constants.PACKAGE_INFO['content_browsertests']
36 else: 38 else:
37 self.suite_path = os.path.join( 39 self.suite_path = os.path.join(
38 constants.GetOutDirectory(), '%s_apk' % suite_name, 40 product_dir, '%s_apk' % suite_name, '%s-debug.apk' % suite_name)
39 '%s-debug.apk' % suite_name)
40 self._package_info = constants.PACKAGE_INFO['gtest'] 41 self._package_info = constants.PACKAGE_INFO['gtest']
41 42
42 def _CreateCommandLineFileOnDevice(self, adb, options): 43 def _CreateCommandLineFileOnDevice(self, adb, options):
43 command_line_file = tempfile.NamedTemporaryFile() 44 command_line_file = tempfile.NamedTemporaryFile()
44 # GTest expects argv[0] to be the executable path. 45 # GTest expects argv[0] to be the executable path.
45 command_line_file.write(self.suite_name + ' ' + options) 46 command_line_file.write(self.suite_name + ' ' + options)
46 command_line_file.flush() 47 command_line_file.flush()
47 adb.PushIfNeeded(command_line_file.name, 48 adb.PushIfNeeded(command_line_file.name,
48 self._package_info.cmdline_file) 49 self._package_info.cmdline_file)
49 50
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 finally: 121 finally:
121 self.tool.CleanUpEnvironment() 122 self.tool.CleanUpEnvironment()
122 logfile = android_commands.NewLineNormalizer(sys.stdout) 123 logfile = android_commands.NewLineNormalizer(sys.stdout)
123 return self._WatchFifo(adb, timeout=10, logfile=logfile) 124 return self._WatchFifo(adb, timeout=10, logfile=logfile)
124 125
125 #override 126 #override
126 def Install(self, adb): 127 def Install(self, adb):
127 self.tool.CopyFiles() 128 self.tool.CopyFiles()
128 adb.ManagedInstall(self.suite_path, False, 129 adb.ManagedInstall(self.suite_path, False,
129 package_name=self._package_info.package) 130 package_name=self._package_info.package)
OLDNEW
« no previous file with comments | « trunk/src/build/android/pylib/gtest/setup.py ('k') | trunk/src/build/android/pylib/gtest/test_package_exe.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698