OLD | NEW |
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 """Gathers information about APKs.""" | 5 """Gathers information about APKs.""" |
6 | 6 |
7 import collections | 7 import collections |
8 import constants | |
9 import logging | 8 import logging |
10 import os | 9 import os |
11 import pickle | 10 import pickle |
12 import re | 11 import re |
13 | 12 |
14 from pylib import cmd_helper | 13 from pylib import cmd_helper |
| 14 from pylib import constants |
15 | 15 |
16 | 16 |
17 # If you change the cached output of proguard, increment this number | 17 # If you change the cached output of proguard, increment this number |
18 PICKLE_FORMAT_VERSION = 1 | 18 PICKLE_FORMAT_VERSION = 1 |
19 | 19 |
20 def GetPackageNameForApk(apk_path): | 20 def GetPackageNameForApk(apk_path): |
21 """Returns the package name of the apk file.""" | 21 """Returns the package name of the apk file.""" |
22 aapt_output = cmd_helper.GetCmdOutput( | 22 aapt_output = cmd_helper.GetCmdOutput( |
23 ['aapt', 'dump', 'badging', apk_path]).split('\n') | 23 ['aapt', 'dump', 'badging', apk_path]).split('\n') |
24 package_name_re = re.compile(r'package: .*name=\'(\S*)\'') | 24 package_name_re = re.compile(r'package: .*name=\'(\S*)\'') |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 if self._IsTestMethod(test) and self._AnnotationsMatchFilters( | 180 if self._IsTestMethod(test) and self._AnnotationsMatchFilters( |
181 annotation_filter_list, annotations)] | 181 annotation_filter_list, annotations)] |
182 | 182 |
183 def GetTestMethods(self): | 183 def GetTestMethods(self): |
184 """Returns a list of all test methods in this apk as Class#testMethod.""" | 184 """Returns a list of all test methods in this apk as Class#testMethod.""" |
185 return self._test_methods | 185 return self._test_methods |
186 | 186 |
187 @staticmethod | 187 @staticmethod |
188 def IsPythonDrivenTest(test): | 188 def IsPythonDrivenTest(test): |
189 return 'pythonDrivenTests' in test | 189 return 'pythonDrivenTests' in test |
OLD | NEW |