OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Provides an interface to communicate with the device via the adb command. | 6 """Provides an interface to communicate with the device via the adb command. |
7 | 7 |
8 Assumes adb binary is currently on system path. | 8 Assumes adb binary is currently on system path. |
9 | 9 |
10 Usage: | 10 Usage: |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 # /foo/bar: | 459 # /foo/bar: |
460 # -rw-r----- 1 user group 102 2011-05-12 12:29:54.131623387 +0100 baz.txt | 460 # -rw-r----- 1 user group 102 2011-05-12 12:29:54.131623387 +0100 baz.txt |
461 re_file = re.compile('^-(?P<perms>[^\s]+)\s+' | 461 re_file = re.compile('^-(?P<perms>[^\s]+)\s+' |
462 '(?P<user>[^\s]+)\s+' | 462 '(?P<user>[^\s]+)\s+' |
463 '(?P<group>[^\s]+)\s+' | 463 '(?P<group>[^\s]+)\s+' |
464 '(?P<size>[^\s]+)\s+' | 464 '(?P<size>[^\s]+)\s+' |
465 '(?P<date>[^\s]+)\s+' | 465 '(?P<date>[^\s]+)\s+' |
466 '(?P<time>[^\s]+)\s+' | 466 '(?P<time>[^\s]+)\s+' |
467 '(?P<filename>[^\s]+)$') | 467 '(?P<filename>[^\s]+)$') |
468 return _GetFilesFromRecursiveLsOutput( | 468 return _GetFilesFromRecursiveLsOutput( |
469 path, self.RunShellCommand('ls -lR %s' % path), re_file, | 469 path, self.RunShellCommand('ls -lR %s' % path, log_result=False), |
bulach
2012/06/25 09:47:51
long story super short: in the past, we had variou
| |
470 self.RunShellCommand('date +%z')[0]) | 470 re_file, self.RunShellCommand('date +%z')[0]) |
471 | 471 |
472 def SetupPerformanceTest(self): | 472 def SetupPerformanceTest(self): |
473 """Sets up performance tests.""" | 473 """Sets up performance tests.""" |
474 # Disable CPU scaling to reduce noise in tests | 474 # Disable CPU scaling to reduce noise in tests |
475 if not self._original_governor: | 475 if not self._original_governor: |
476 self._original_governor = self.RunShellCommand('cat ' + SCALING_GOVERNOR) | 476 self._original_governor = self.RunShellCommand('cat ' + SCALING_GOVERNOR) |
477 self.RunShellCommand('echo performance > ' + SCALING_GOVERNOR) | 477 self.RunShellCommand('echo performance > ' + SCALING_GOVERNOR) |
478 self.DropRamCaches() | 478 self.DropRamCaches() |
479 | 479 |
480 def TearDownPerformanceTest(self): | 480 def TearDownPerformanceTest(self): |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
771 options, args = option_parser.parse_args(argv) | 771 options, args = option_parser.parse_args(argv) |
772 | 772 |
773 commands = AndroidCommands(wait_for_pm=options.wait_for_pm) | 773 commands = AndroidCommands(wait_for_pm=options.wait_for_pm) |
774 if options.set_asserts != None: | 774 if options.set_asserts != None: |
775 if commands.SetJavaAssertsEnabled(options.set_asserts): | 775 if commands.SetJavaAssertsEnabled(options.set_asserts): |
776 commands.Reboot(full_reboot=False) | 776 commands.Reboot(full_reboot=False) |
777 | 777 |
778 | 778 |
779 if __name__ == '__main__': | 779 if __name__ == '__main__': |
780 main(sys.argv) | 780 main(sys.argv) |
OLD | NEW |