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

Side by Side Diff: build/android/pylib/instrumentation/test_package.py

Issue 1208483004: Make instrumentation test dependency on a support APK explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« 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
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 4 # found in the LICENSE file.
4 5
5 """Class representing instrumentation test apk and jar.""" 6 """Class representing instrumentation test apk and jar."""
6 7
7 import os 8 import os
8 9
9 from pylib.instrumentation import test_jar 10 from pylib.instrumentation import test_jar
10 from pylib.utils import apk_helper 11 from pylib.utils import apk_helper
11 12
12 13
13 class TestPackage(test_jar.TestJar): 14 class TestPackage(test_jar.TestJar):
14 def __init__(self, apk_path, jar_path, test_support_apk_path): 15 def __init__(self, apk_path, jar_path, test_support_apk_path):
15 test_jar.TestJar.__init__(self, jar_path) 16 test_jar.TestJar.__init__(self, jar_path)
16 17
17 if not os.path.exists(apk_path): 18 if not os.path.exists(apk_path):
18 raise Exception('%s not found, please build it' % apk_path) 19 raise Exception('%s not found, please build it' % apk_path)
20 if not os.path.exists(test_support_apk_path):
jbudorick 2015/06/24 13:05:11 As written, this requires each test apk have a tes
dgn 2015/06/24 14:06:53 Right, we don't. I'm currently rewriting the CL. I
dgn 2015/06/24 16:03:04 Done.
21 raise Exception('%s not found, please build it' % test_support_apk_path)
19 self._apk_path = apk_path 22 self._apk_path = apk_path
20 self._apk_name = os.path.splitext(os.path.basename(apk_path))[0] 23 self._apk_name = os.path.splitext(os.path.basename(apk_path))[0]
21 self._package_name = apk_helper.GetPackageName(self._apk_path) 24 self._package_name = apk_helper.GetPackageName(self._apk_path)
22 self._test_support_apk_path = test_support_apk_path 25 self._test_support_apk_path = test_support_apk_path
23 26
24 def GetApkPath(self): 27 def GetApkPath(self):
25 """Returns the absolute path to the APK.""" 28 """Returns the absolute path to the APK."""
26 return self._apk_path 29 return self._apk_path
27 30
28 def GetApkName(self): 31 def GetApkName(self):
29 """Returns the name of the apk without the suffix.""" 32 """Returns the name of the apk without the suffix."""
30 return self._apk_name 33 return self._apk_name
31 34
32 def GetPackageName(self): 35 def GetPackageName(self):
33 """Returns the package name of this APK.""" 36 """Returns the package name of this APK."""
34 return self._package_name 37 return self._package_name
35 38
36 # Override. 39 # Override.
37 def Install(self, device): 40 def Install(self, device):
38 device.Install(self.GetApkPath()) 41 device.Install(self.GetApkPath())
39 if (self._test_support_apk_path and 42 if (self._test_support_apk_path and
40 os.path.exists(self._test_support_apk_path)): 43 os.path.exists(self._test_support_apk_path)):
41 device.Install(self._test_support_apk_path) 44 device.Install(self._test_support_apk_path)
42 45
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