OLD | NEW |
1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 self._android_devices.set_device_prepared(self._android_commands.get_ser
ial()) | 845 self._android_devices.set_device_prepared(self._android_commands.get_ser
ial()) |
846 | 846 |
847 def _log_error(self, message): | 847 def _log_error(self, message): |
848 _log.error('[%s] %s' % (self._android_commands.get_serial(), message)) | 848 _log.error('[%s] %s' % (self._android_commands.get_serial(), message)) |
849 | 849 |
850 def _log_debug(self, message): | 850 def _log_debug(self, message): |
851 if self._debug_logging: | 851 if self._debug_logging: |
852 _log.debug('[%s] %s' % (self._android_commands.get_serial(), message
)) | 852 _log.debug('[%s] %s' % (self._android_commands.get_serial(), message
)) |
853 | 853 |
854 def _abort(self, message): | 854 def _abort(self, message): |
855 raise AssertionError('[%s] %s' % (self._android_commands.get_serial(), m
essage)) | 855 raise driver.DeviceOffline('[%s] %s' % (self._android_commands.get_seria
l(), message)) |
856 | 856 |
857 @staticmethod | 857 @staticmethod |
858 def _extract_hashes_from_md5sum_output(md5sum_output): | 858 def _extract_hashes_from_md5sum_output(md5sum_output): |
859 assert md5sum_output | 859 assert md5sum_output |
860 return [line.split(' ')[0] for line in md5sum_output] | 860 return [line.split(' ')[0] for line in md5sum_output] |
861 | 861 |
862 def _files_match(self, host_file, device_file): | 862 def _files_match(self, host_file, device_file): |
863 assert self._port.host.filesystem.exists(host_file) | 863 assert self._port.host.filesystem.exists(host_file) |
864 device_hashes = self._extract_hashes_from_md5sum_output( | 864 device_hashes = self._extract_hashes_from_md5sum_output( |
865 self._port.host.executive.popen(self._android_commands.adb_comma
nd() + ['shell', MD5SUM_DEVICE_PATH, device_file], | 865 self._port.host.executive.popen(self._android_commands.adb_comma
nd() + ['shell', MD5SUM_DEVICE_PATH, device_file], |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 return command | 1138 return command |
1139 | 1139 |
1140 def _read_prompt(self, deadline): | 1140 def _read_prompt(self, deadline): |
1141 last_char = '' | 1141 last_char = '' |
1142 while True: | 1142 while True: |
1143 current_char = self._server_process.read_stdout(deadline, 1) | 1143 current_char = self._server_process.read_stdout(deadline, 1) |
1144 if current_char == ' ': | 1144 if current_char == ' ': |
1145 if last_char in ('#', '$'): | 1145 if last_char in ('#', '$'): |
1146 return | 1146 return |
1147 last_char = current_char | 1147 last_char = current_char |
OLD | NEW |