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

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

Issue 386053002: [Android] Switch to DeviceUtils versions of GetPid, TakeScreenshot, and GetIoStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 6 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
« no previous file with comments | « build/android/pylib/forwarder.py ('k') | build/android/pylib/monkey/test_runner.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 instrumentation tests on a single device.""" 5 """Class for running instrumentation tests on a single device."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if self.coverage_dir: 135 if self.coverage_dir:
136 ret['coverage'] = 'true' 136 ret['coverage'] = 'true'
137 ret['coverageFile'] = self.coverage_device_file 137 ret['coverageFile'] = self.coverage_device_file
138 138
139 return ret 139 return ret
140 140
141 def _TakeScreenshot(self, test): 141 def _TakeScreenshot(self, test):
142 """Takes a screenshot from the device.""" 142 """Takes a screenshot from the device."""
143 screenshot_name = os.path.join(constants.SCREENSHOTS_DIR, '%s.png' % test) 143 screenshot_name = os.path.join(constants.SCREENSHOTS_DIR, '%s.png' % test)
144 logging.info('Taking screenshot named %s', screenshot_name) 144 logging.info('Taking screenshot named %s', screenshot_name)
145 self.device.old_interface.TakeScreenshot(screenshot_name) 145 self.device.TakeScreenshot(screenshot_name)
146 146
147 def SetUp(self): 147 def SetUp(self):
148 """Sets up the test harness and device before all tests are run.""" 148 """Sets up the test harness and device before all tests are run."""
149 super(TestRunner, self).SetUp() 149 super(TestRunner, self).SetUp()
150 if not self.device.HasRoot(): 150 if not self.device.HasRoot():
151 logging.warning('Unable to enable java asserts for %s, non rooted device', 151 logging.warning('Unable to enable java asserts for %s, non rooted device',
152 str(self.device)) 152 str(self.device))
153 else: 153 else:
154 if self.device.SetJavaAsserts(True): 154 if self.device.SetJavaAsserts(True):
155 # TODO(jbudorick) How to best do shell restart after the 155 # TODO(jbudorick) How to best do shell restart after the
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 duration_ms = 0 387 duration_ms = 0
388 message = str(e) 388 message = str(e)
389 if not message: 389 if not message:
390 message = 'No information.' 390 message = 'No information.'
391 results.AddResult(test_result.InstrumentationTestResult( 391 results.AddResult(test_result.InstrumentationTestResult(
392 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms, 392 test, base_test_result.ResultType.CRASH, start_date_ms, duration_ms,
393 log=message)) 393 log=message))
394 raw_result = None 394 raw_result = None
395 self.TestTeardown(test, raw_result) 395 self.TestTeardown(test, raw_result)
396 return (results, None if results.DidRunPass() else test) 396 return (results, None if results.DidRunPass() else test)
OLDNEW
« no previous file with comments | « build/android/pylib/forwarder.py ('k') | build/android/pylib/monkey/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698