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

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

Issue 1800283002: [Android] Fix instrumentation clearing application state twice and not setting permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | 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 collections 7 import collections
8 import logging 8 import logging
9 import os 9 import os
10 import re 10 import re
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 if self.coverage_dir: 237 if self.coverage_dir:
238 self.device.PullFile( 238 self.device.PullFile(
239 self.coverage_device_file, self.coverage_host_file) 239 self.coverage_device_file, self.coverage_host_file)
240 self.device.RunShellCommand( 240 self.device.RunShellCommand(
241 'rm -f %s' % self.coverage_device_file) 241 'rm -f %s' % self.coverage_device_file)
242 elif self.package_info and not self.options.skip_clear_data: 242 elif self.package_info and not self.options.skip_clear_data:
243 apk_under_test = self.test_pkg.GetApkUnderTest() 243 apk_under_test = self.test_pkg.GetApkUnderTest()
244 permissions = apk_under_test.GetPermissions() if apk_under_test else None 244 permissions = apk_under_test.GetPermissions() if apk_under_test else None
245 self.device.ClearApplicationState( 245 self.device.ClearApplicationState(
246 self.package_info.package, permissions=permissions) 246 self.package_info.package, permissions=permissions)
247 self.device.ClearApplicationState(self.package_info.package)
248 247
249 def TearDownPerfMonitoring(self, test): 248 def TearDownPerfMonitoring(self, test):
250 """Cleans up performance monitoring if the specified test required it. 249 """Cleans up performance monitoring if the specified test required it.
251 250
252 Args: 251 Args:
253 test: The name of the test that was just run. 252 test: The name of the test that was just run.
254 Raises: 253 Raises:
255 Exception: if there's anything wrong with the perf data. 254 Exception: if there's anything wrong with the perf data.
256 """ 255 """
257 if not self._IsPerfTest(test): 256 if not self._IsPerfTest(test):
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 result_name, ' '.join(flag_modifiers.add)) 425 result_name, ' '.join(flag_modifiers.add))
427 if flag_modifiers.remove: 426 if flag_modifiers.remove:
428 result_name = '%s without {%s}' % ( 427 result_name = '%s without {%s}' % (
429 result_name, ' '.join(flag_modifiers.remove)) 428 result_name, ' '.join(flag_modifiers.remove))
430 result.SetName(result_name) 429 result.SetName(result_name)
431 results.AddResult(result) 430 results.AddResult(result)
432 431
433 self.TestTeardown(test, results) 432 self.TestTeardown(test, results)
434 433
435 return (results, None if results.DidRunPass() else test) 434 return (results, None if results.DidRunPass() else test)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698