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 for running uiautomator tests on a single device.""" | |
6 | |
7 from pylib.instrumentation import test_runner as instr_test_runner | |
8 | |
9 | |
10 class TestRunner(instr_test_runner.TestRunner): | |
11 """Responsible for running a series of tests connected to a single device.""" | |
12 | |
13 def __init__(self, options, device, shard_index, test_pkg, ports_to_forward): | |
14 """Create a new TestRunner. | |
15 | |
16 Args: | |
17 options: An options object similar to the one in parent class plus: | |
18 - package_name: Application package name under test. | |
19 """ | |
20 options.ensure_value('install_apk', True) | |
21 options.ensure_value('wait_for_debugger', False) | |
22 super(TestRunner, self).__init__( | |
23 options, device, shard_index, test_pkg, ports_to_forward) | |
24 | |
25 self.package_name = options.package_name | |
26 | |
27 #override. | |
craigdh
2013/04/12 17:32:14
no .
frankf
2013/04/12 18:00:13
Done.
| |
28 def PushDependencies(self): | |
29 self.test_pkg.Install(self.adb) | |
30 | |
31 #override. | |
craigdh
2013/04/12 17:32:14
ditto
frankf
2013/04/12 18:00:13
Done.
| |
32 def _RunTest(self, test, timeout): | |
33 self.adb.ClearApplicationState(self.package_name) | |
34 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): | |
35 self.flags.RemoveFlags(['--disable-fre']) | |
36 else: | |
37 self.flags.AddFlags(['--disable-fre']) | |
38 return self.adb.RunUIAutomatorTest( | |
39 test, self.test_pkg.GetPackageName(), timeout) | |
40 | |
OLD | NEW |