OLD | NEW |
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 """Provides an interface to communicate with the device via the adb command. | 5 """Provides an interface to communicate with the device via the adb command. |
6 | 6 |
7 Assumes adb binary is currently on system path. | 7 Assumes adb binary is currently on system path. |
8 """ | 8 """ |
9 | 9 |
10 import collections | 10 import collections |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 assert os.path.exists(local_path), 'Local path not found %s' % local_path | 541 assert os.path.exists(local_path), 'Local path not found %s' % local_path |
542 | 542 |
543 if not self._md5sum_path: | 543 if not self._md5sum_path: |
544 default_build_type = os.environ.get('BUILD_TYPE', 'Debug') | 544 default_build_type = os.environ.get('BUILD_TYPE', 'Debug') |
545 md5sum_path = '%s/out/%s/md5sum_bin' % (CHROME_SRC, default_build_type) | 545 md5sum_path = '%s/out/%s/md5sum_bin' % (CHROME_SRC, default_build_type) |
546 if not os.path.exists(md5sum_path): | 546 if not os.path.exists(md5sum_path): |
547 md5sum_path = '%s/out/Release/md5sum_bin' % (CHROME_SRC) | 547 md5sum_path = '%s/out/Release/md5sum_bin' % (CHROME_SRC) |
548 if not os.path.exists(md5sum_path): | 548 if not os.path.exists(md5sum_path): |
549 print >>sys.stderr, 'Please build md5sum.' | 549 print >>sys.stderr, 'Please build md5sum.' |
550 sys.exit(1) | 550 sys.exit(1) |
551 if not self.FileExistsOnDevice(MD5SUM_DEVICE_PATH): | 551 command = 'push %s %s' % (md5sum_path, MD5SUM_DEVICE_PATH) |
552 command = 'push %s %s' % (md5sum_path, MD5SUM_DEVICE_PATH) | 552 assert _HasAdbPushSucceeded(self._adb.SendCommand(command)) |
553 assert _HasAdbPushSucceeded(self._adb.SendCommand(command)) | |
554 self._md5sum_path = md5sum_path | 553 self._md5sum_path = md5sum_path |
555 | 554 |
556 self._pushed_files.append(device_path) | 555 self._pushed_files.append(device_path) |
557 hashes_on_device = _ComputeFileListHash( | 556 hashes_on_device = _ComputeFileListHash( |
558 self.RunShellCommand(MD5SUM_DEVICE_PATH + ' ' + device_path)) | 557 self.RunShellCommand(MD5SUM_DEVICE_PATH + ' ' + device_path)) |
559 assert os.path.exists(local_path), 'Local path not found %s' % local_path | 558 assert os.path.exists(local_path), 'Local path not found %s' % local_path |
560 hashes_on_host = _ComputeFileListHash( | 559 hashes_on_host = _ComputeFileListHash( |
561 subprocess.Popen( | 560 subprocess.Popen( |
562 '%s_host %s' % (self._md5sum_path, local_path), | 561 '%s_host %s' % (self._md5sum_path, local_path), |
563 stdout=subprocess.PIPE, shell=True).stdout) | 562 stdout=subprocess.PIPE, shell=True).stdout) |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 ' '.join(['-c %s' % c for c in category]), | 1029 ' '.join(['-c %s' % c for c in category]), |
1031 '--throttle %d' % throttle, | 1030 '--throttle %d' % throttle, |
1032 '-s %d' % seed, | 1031 '-s %d' % seed, |
1033 '-v ' * verbosity, | 1032 '-v ' * verbosity, |
1034 '--monitor-native-crashes', | 1033 '--monitor-native-crashes', |
1035 '--kill-process-after-error', | 1034 '--kill-process-after-error', |
1036 extra_args, | 1035 extra_args, |
1037 '%d' % event_count] | 1036 '%d' % event_count] |
1038 return self.RunShellCommand(' '.join(cmd), | 1037 return self.RunShellCommand(' '.join(cmd), |
1039 timeout_time=event_count*throttle*1.5) | 1038 timeout_time=event_count*throttle*1.5) |
OLD | NEW |