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

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

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 (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 import constants 7 from pylib import constants
8 from pylib import flag_changer 8 from pylib import flag_changer
9 from pylib.device import intent 9 from pylib.device import intent
10 from pylib.instrumentation import test_options as instr_test_options 10 from pylib.instrumentation import test_options as instr_test_options
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test): 66 if 'Feature:FirstRunExperience' in self.test_pkg.GetTestAnnotations(test):
67 self.flags.RemoveFlags(['--disable-fre']) 67 self.flags.RemoveFlags(['--disable-fre'])
68 else: 68 else:
69 self.flags.AddFlags(['--disable-fre']) 69 self.flags.AddFlags(['--disable-fre'])
70 self.device.StartActivity( 70 self.device.StartActivity(
71 intent.Intent(action='android.intent.action.MAIN', 71 intent.Intent(action='android.intent.action.MAIN',
72 activity=self._activity, 72 activity=self._activity,
73 package=self._package), 73 package=self._package),
74 blocking=True, 74 blocking=True,
75 force_stop=True) 75 force_stop=True)
76 cmd = ['uiautomator', 'runtest', self.test_pkg.GetPackageName(), 76 cmd = ['uiautomator', 'runtest',
77 self.test_pkg.UIAUTOMATOR_PATH + self.test_pkg.GetPackageName(),
77 '-e', 'class', test] 78 '-e', 'class', test]
78 return self.device.RunShellCommand(cmd, timeout=timeout, retries=0) 79 return self.device.RunShellCommand(cmd, timeout=timeout, retries=0)
79 80
80 #override 81 #override
81 def _GenerateTestResult(self, test, instr_statuses, start_ms, duration_ms): 82 def _GenerateTestResult(self, test, instr_statuses, start_ms, duration_ms):
82 # uiautomator emits its summary status with INSTRUMENTATION_STATUS_CODE, 83 # uiautomator emits its summary status with INSTRUMENTATION_STATUS_CODE,
83 # not INSTRUMENTATION_CODE, so we have to drop if off the list of statuses. 84 # not INSTRUMENTATION_CODE, so we have to drop if off the list of statuses.
84 return super(TestRunner, self)._GenerateTestResult( 85 return super(TestRunner, self)._GenerateTestResult(
85 test, instr_statuses[:-1], start_ms, duration_ms) 86 test, instr_statuses[:-1], start_ms, duration_ms)
OLDNEW
« no previous file with comments | « build/android/pylib/uiautomator/test_package.py ('k') | build/android/pylib/utils/flakiness_dashboard_results_uploader.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698