Chromium Code Reviews| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 def package_name(self): | 165 def package_name(self): |
| 166 return 'org.chromium.content_shell_apk' | 166 return 'org.chromium.content_shell_apk' |
| 167 | 167 |
| 168 def activity_name(self): | 168 def activity_name(self): |
| 169 return self.package_name() + '/.ContentShellActivity' | 169 return self.package_name() + '/.ContentShellActivity' |
| 170 | 170 |
| 171 def library_name(self): | 171 def library_name(self): |
| 172 return 'libcontent_shell_content_view.so' | 172 return 'libcontent_shell_content_view.so' |
| 173 | 173 |
| 174 def additional_resources(self): | 174 def additional_resources(self): |
| 175 return ['content_resources.pak', 'content_shell.pak', 'shell_resources.p ak'] | 175 return [] |
|
agrieve
2016/04/12 20:36:47
Android shouldn't need these to be side-loaded sin
| |
| 176 | 176 |
| 177 def command_line_file(self): | 177 def command_line_file(self): |
| 178 return '/data/local/tmp/content-shell-command-line' | 178 return '/data/local/tmp/content-shell-command-line' |
| 179 | 179 |
| 180 def device_crash_dumps_directory(self): | 180 def device_crash_dumps_directory(self): |
| 181 return '/data/local/tmp/content-shell-crash-dumps' | 181 return '/data/local/tmp/content-shell-crash-dumps' |
| 182 | 182 |
| 183 def additional_command_line_flags(self, use_breakpad): | 183 def additional_command_line_flags(self, use_breakpad): |
| 184 flags = ['--encode-binary'] | 184 flags = ['--encode-binary'] |
| 185 if use_breakpad: | 185 if use_breakpad: |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 933 def _abort(self, message): | 933 def _abort(self, message): |
| 934 self._device_failed = True | 934 self._device_failed = True |
| 935 raise driver.DeviceFailure('[%s] %s' % (self._android_commands.get_seria l(), message)) | 935 raise driver.DeviceFailure('[%s] %s' % (self._android_commands.get_seria l(), message)) |
| 936 | 936 |
| 937 @staticmethod | 937 @staticmethod |
| 938 def _extract_hashes_from_md5sum_output(md5sum_output): | 938 def _extract_hashes_from_md5sum_output(md5sum_output): |
| 939 assert md5sum_output | 939 assert md5sum_output |
| 940 return [line.split(' ')[0] for line in md5sum_output] | 940 return [line.split(' ')[0] for line in md5sum_output] |
| 941 | 941 |
| 942 def _files_match(self, host_file, device_file): | 942 def _files_match(self, host_file, device_file): |
| 943 assert self._port.host.filesystem.exists(host_file) | 943 assert self._port.host.filesystem.exists(host_file), host_file |
| 944 device_hashes = self._extract_hashes_from_md5sum_output( | 944 device_hashes = self._extract_hashes_from_md5sum_output( |
| 945 self._port.host.executive.popen(self._android_commands.adb_command() + ['shell', MD5SUM_DEVICE_PATH, device_file], | 945 self._port.host.executive.popen(self._android_commands.adb_command() + ['shell', MD5SUM_DEVICE_PATH, device_file], |
| 946 stdout=subprocess.PIPE).stdout) | 946 stdout=subprocess.PIPE).stdout) |
| 947 host_hashes = self._extract_hashes_from_md5sum_output( | 947 host_hashes = self._extract_hashes_from_md5sum_output( |
| 948 self._port.host.executive.popen(args=['%s_host' % self._md5sum_path, host_file], | 948 self._port.host.executive.popen(args=['%s_host' % self._md5sum_path, host_file], |
| 949 stdout=subprocess.PIPE).stdout) | 949 stdout=subprocess.PIPE).stdout) |
| 950 return host_hashes and device_hashes == host_hashes | 950 return host_hashes and device_hashes == host_hashes |
| 951 | 951 |
| 952 def _push_file_if_needed(self, host_file, device_file, log_callback): | 952 def _push_file_if_needed(self, host_file, device_file, log_callback): |
| 953 basename = self._port.host.filesystem.basename(host_file) | 953 basename = self._port.host.filesystem.basename(host_file) |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1301 return command | 1301 return command |
| 1302 | 1302 |
| 1303 def _read_prompt(self, deadline): | 1303 def _read_prompt(self, deadline): |
| 1304 last_char = '' | 1304 last_char = '' |
| 1305 while True: | 1305 while True: |
| 1306 current_char = self._server_process.read_stdout(deadline, 1) | 1306 current_char = self._server_process.read_stdout(deadline, 1) |
| 1307 if current_char == ' ': | 1307 if current_char == ' ': |
| 1308 if last_char in ('#', '$'): | 1308 if last_char in ('#', '$'): |
| 1309 return | 1309 return |
| 1310 last_char = current_char | 1310 last_char = current_char |
| OLD | NEW |