OLD | NEW |
(Empty) | |
| 1 # 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 # found in the LICENSE file. |
| 4 |
| 5 """Class representing instrumentation test apk and jar.""" |
| 6 |
| 7 import os |
| 8 |
| 9 from pylib.utils import apk_helper |
| 10 |
| 11 import test_jar |
| 12 |
| 13 |
| 14 class TestPackage(test_jar.TestJar): |
| 15 def __init__(self, apk_path, jar_path): |
| 16 test_jar.TestJar.__init__(self, jar_path) |
| 17 |
| 18 if not os.path.exists(apk_path): |
| 19 raise Exception('%s not found, please build it' % apk_path) |
| 20 self._apk_path = apk_path |
| 21 |
| 22 def GetApkPath(self): |
| 23 return self._apk_path |
| 24 |
| 25 def GetPackageName(self): |
| 26 """Returns the package name of this APK.""" |
| 27 return apk_helper.GetPackageName(self._apk_path) |
| 28 |
| 29 # Override. |
| 30 def Install(self, adb): |
| 31 adb.ManagedInstall(self.GetApkPath(), package_name=self.GetPackageName()) |
OLD | NEW |