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

Side by Side Diff: build/android/pylib/uirobot/uirobot_test_instance.py

Issue 891423002: Reland device filtering and device file cl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
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 json
7 import logging
6 8
7 from pylib import constants 9 from pylib import constants
8 from pylib.base import test_instance 10 from pylib.base import test_instance
9 from pylib.utils import apk_helper 11 from pylib.utils import apk_helper
10 12
11 class UirobotTestInstance(test_instance.TestInstance): 13 class UirobotTestInstance(test_instance.TestInstance):
12 14
13 def __init__(self, args, error_func): 15 def __init__(self, args, error_func):
14 """Constructor. 16 """Constructor.
15 17
16 Args: 18 Args:
17 args: Command line arguments. 19 args: Command line arguments.
18 """ 20 """
19 super(UirobotTestInstance, self).__init__() 21 super(UirobotTestInstance, self).__init__()
20 if not args.app_under_test: 22 if not args.app_under_test:
21 error_func('Must set --app-under-test.') 23 error_func('Must set --app-under-test.')
22 self._app_under_test = args.app_under_test 24 self._app_under_test = args.app_under_test
25 self._minutes = args.minutes
23 26
24 if args.device_type == 'Android': 27 if args.device_type == 'Android':
25 self._suite = 'Android Uirobot' 28 self._suite = 'Android Uirobot'
26 self._package_name = apk_helper.GetPackageName(self._app_under_test) 29 self._package_name = apk_helper.GetPackageName(self._app_under_test)
27
28 elif args.device_type == 'iOS': 30 elif args.device_type == 'iOS':
29 self._suite = 'iOS Uirobot' 31 self._suite = 'iOS Uirobot'
30 self._package_name = self._app_under_test 32 self._package_name = self._app_under_test
31 33
32 self._minutes = args.minutes
33 34
34 #override 35 #override
35 def TestType(self): 36 def TestType(self):
36 """Returns type of test.""" 37 """Returns type of test."""
37 return 'uirobot' 38 return 'uirobot'
38 39
39 #override 40 #override
40 def SetUp(self): 41 def SetUp(self):
41 """Setup for test.""" 42 """Setup for test."""
42 pass 43 pass
(...skipping 14 matching lines...) Expand all
57 return self._minutes 58 return self._minutes
58 59
59 @property 60 @property
60 def package_name(self): 61 def package_name(self):
61 """Returns the name of the package in the APK.""" 62 """Returns the name of the package in the APK."""
62 return self._package_name 63 return self._package_name
63 64
64 @property 65 @property
65 def suite(self): 66 def suite(self):
66 return self._suite 67 return self._suite
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698