Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 os | 5 import os |
| 6 import sys | |
| 6 | 7 |
| 7 from pylib import constants | 8 from pylib import constants |
| 9 | |
| 10 sys.path.append(os.path.join( | |
| 11 constants.DIR_SOURCE_ROOT, 'build', 'android', 'pylib')) | |
| 12 | |
| 8 from pylib.base import test_instance | 13 from pylib.base import test_instance |
| 9 from pylib.utils import apk_helper | |
| 10 | 14 |
| 11 class UirobotTestInstance(test_instance.TestInstance): | 15 class UirobotTestInstance(test_instance.TestInstance): |
| 12 | 16 |
| 13 def __init__(self, args): | 17 def __init__(self, args): |
| 14 """Constructor. | 18 """Constructor. |
| 15 | 19 |
| 16 Args: | 20 Args: |
| 17 args: Command line arguments. | 21 args: Command line arguments. |
| 18 """ | 22 """ |
| 19 super(UirobotTestInstance, self).__init__() | 23 super(UirobotTestInstance, self).__init__() |
| 20 self._apk_under_test = os.path.join( | 24 if args.app_under_test: |
| 21 constants.GetOutDirectory(), args.apk_under_test) | 25 self._app_under_test = os.path.join( |
| 26 constants.GetOutDirectory(), args.app_under_test) | |
| 27 else: | |
| 28 raise NotImplementedError | |
|
rnephew (Wrong account)
2015/01/09 20:57:14
Need to know the correct default location for Blin
| |
| 29 self._app_under_test = os.path.join( | |
| 30 constants.GetOutDirectory(), 'apks/Chrome.apk') | |
| 31 | |
| 22 self._minutes = args.minutes | 32 self._minutes = args.minutes |
| 23 self._package_name = apk_helper.GetPackageName(self._apk_under_test) | 33 self._package_name = self._app_under_test |
| 24 self._suite = 'Android Uirobot' | 34 self._suite = 'iOS Uirobot' |
| 25 | 35 |
| 26 #override | 36 #override |
| 27 def TestType(self): | 37 def TestType(self): |
| 28 """Returns type of test.""" | 38 """Returns type of test.""" |
| 29 return 'uirobot' | 39 return 'uirobot' |
| 30 | 40 |
| 31 #override | 41 #override |
| 32 def SetUp(self): | 42 def SetUp(self): |
| 33 """Setup for test.""" | 43 """Setup for test.""" |
| 34 pass | 44 pass |
| 35 | 45 |
| 36 #override | 46 #override |
| 37 def TearDown(self): | 47 def TearDown(self): |
| 38 """Teardown for test.""" | 48 """Teardown for test.""" |
| 39 pass | 49 pass |
| 40 | 50 |
| 41 @property | 51 @property |
| 42 def apk_under_test(self): | 52 def app_under_test(self): |
| 43 """Returns the app to run the test on.""" | 53 """Returns the app to run the test on.""" |
| 44 return self._apk_under_test | 54 return self._app_under_test |
| 45 | 55 |
| 46 @property | 56 @property |
| 47 def minutes(self): | 57 def minutes(self): |
| 48 """Returns the number of minutes to run the uirobot for.""" | 58 """Returns the number of minutes to run the uirobot for.""" |
| 49 return self._minutes | 59 return self._minutes |
| 50 | 60 |
| 51 @property | 61 @property |
| 52 def package_name(self): | 62 def package_name(self): |
| 53 """Returns the name of the package in the APK.""" | 63 """Returns the name of the package in the APK.""" |
| 54 return self._package_name | 64 return self._package_name |
| 55 | 65 |
| 56 @property | 66 @property |
| 57 def suite(self): | 67 def suite(self): |
| 58 return self._suite | 68 return self._suite |
| OLD | NEW |