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

Side by Side Diff: build/android/pylib/uiautomator/test_runner.py

Issue 19799003: [android] Instumentation tests determine whether to install test apk based on Md5Sum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed reference in uiautomator Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 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 """Class for running uiautomator tests on a single device.""" 5 """Class for running uiautomator tests on a single device."""
6 6
7 from pylib.instrumentation import test_runner as instr_test_runner 7 from pylib.instrumentation import test_runner as instr_test_runner
8 8
9 9
10 class TestRunner(instr_test_runner.TestRunner): 10 class TestRunner(instr_test_runner.TestRunner):
11 """Responsible for running a series of tests connected to a single device.""" 11 """Responsible for running a series of tests connected to a single device."""
12 12
13 def __init__(self, options, device, shard_index, test_pkg, ports_to_forward): 13 def __init__(self, options, device, shard_index, test_pkg, ports_to_forward):
14 """Create a new TestRunner. 14 """Create a new TestRunner.
15 15
16 Args: 16 Args:
17 options: An options object similar to the one in parent class plus: 17 options: An options object similar to the one in parent class plus:
18 - package_name: Application package name under test. 18 - package_name: Application package name under test.
19 """ 19 """
20 options.ensure_value('install_apk', True)
21 options.ensure_value('wait_for_debugger', False) 20 options.ensure_value('wait_for_debugger', False)
22 super(TestRunner, self).__init__( 21 super(TestRunner, self).__init__(
23 options, device, shard_index, test_pkg, ports_to_forward) 22 options, device, shard_index, test_pkg, ports_to_forward)
24 23
25 self.package_name = options.package_name 24 self.package_name = options.package_name
26 25
27 #override 26 #override
28 def InstallTestPackage(self): 27 def InstallTestPackage(self):
29 self.test_pkg.Install(self.adb) 28 self.test_pkg.Install(self.adb)
30 29
31 #override 30 #override
32 def PushDataDeps(self): 31 def PushDataDeps(self):
33 pass 32 pass
34 33
35 #override 34 #override
36 def _RunTest(self, test, timeout): 35 def _RunTest(self, test, timeout):
37 self.adb.ClearApplicationState(self.package_name) 36 self.adb.ClearApplicationState(self.package_name)
38 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): 37 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test):
39 self.flags.RemoveFlags(['--disable-fre']) 38 self.flags.RemoveFlags(['--disable-fre'])
40 else: 39 else:
41 self.flags.AddFlags(['--disable-fre']) 40 self.flags.AddFlags(['--disable-fre'])
42 return self.adb.RunUIAutomatorTest( 41 return self.adb.RunUIAutomatorTest(
43 test, self.test_pkg.GetPackageName(), timeout) 42 test, self.test_pkg.GetPackageName(), timeout)
44 43
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698