| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 # List of test resources from webkit platform. These resources will be copied to
the external storage. | 136 # List of test resources from webkit platform. These resources will be copied to
the external storage. |
| 137 WEBKIT_PLATFORM_RESOURCES_TO_PUSH = [ | 137 WEBKIT_PLATFORM_RESOURCES_TO_PUSH = [ |
| 138 'third_party/hyphen/hyph_en_US.dic', | 138 'third_party/hyphen/hyph_en_US.dic', |
| 139 ] | 139 ] |
| 140 | 140 |
| 141 MD5SUM_DEVICE_FILE_NAME = 'md5sum_bin' | 141 MD5SUM_DEVICE_FILE_NAME = 'md5sum_bin' |
| 142 MD5SUM_HOST_FILE_NAME = 'md5sum_bin_host' | 142 MD5SUM_HOST_FILE_NAME = 'md5sum_bin_host' |
| 143 MD5SUM_DEVICE_PATH = '/data/local/tmp/' + MD5SUM_DEVICE_FILE_NAME | 143 MD5SUM_DEVICE_PATH = '/data/local/tmp/' + MD5SUM_DEVICE_FILE_NAME |
| 144 | 144 |
| 145 # Shared pieces of information for the two supported test runners. | 145 |
| 146 class SharedDriverDetails(object): | 146 # Information required when running layout tests using content_shell as the test
runner. |
| 147 class ContentShellDriverDetails(): |
| 147 def device_cache_directory(self): | 148 def device_cache_directory(self): |
| 148 return self.device_directory() + 'cache/' | 149 return self.device_directory() + 'cache/' |
| 150 |
| 149 def device_fonts_directory(self): | 151 def device_fonts_directory(self): |
| 150 return self.device_directory() + 'fonts/' | 152 return self.device_directory() + 'fonts/' |
| 153 |
| 151 def device_forwarder_path(self): | 154 def device_forwarder_path(self): |
| 152 return self.device_directory() + 'forwarder' | 155 return self.device_directory() + 'forwarder' |
| 156 |
| 153 def device_fifo_directory(self): | 157 def device_fifo_directory(self): |
| 154 return '/data/data/' + self.package_name() + '/files/' | 158 return '/data/data/' + self.package_name() + '/files/' |
| 155 | 159 |
| 156 # Information required when running layout tests using content_shell as the test
runner. | |
| 157 class ContentShellDriverDetails(SharedDriverDetails): | |
| 158 def apk_name(self): | 160 def apk_name(self): |
| 159 return 'apks/ContentShell.apk' | 161 return 'apks/ContentShell.apk' |
| 162 |
| 160 def package_name(self): | 163 def package_name(self): |
| 161 return 'org.chromium.content_shell_apk' | 164 return 'org.chromium.content_shell_apk' |
| 165 |
| 162 def activity_name(self): | 166 def activity_name(self): |
| 163 return self.package_name() + '/.ContentShellActivity' | 167 return self.package_name() + '/.ContentShellActivity' |
| 168 |
| 164 def library_name(self): | 169 def library_name(self): |
| 165 return 'libcontent_shell_content_view.so' | 170 return 'libcontent_shell_content_view.so' |
| 171 |
| 166 def additional_resources(self): | 172 def additional_resources(self): |
| 167 return ['content_resources.pak', 'shell_resources.pak'] | 173 return ['content_resources.pak', 'shell_resources.pak'] |
| 174 |
| 168 def command_line_file(self): | 175 def command_line_file(self): |
| 169 return '/data/local/tmp/content-shell-command-line' | 176 return '/data/local/tmp/content-shell-command-line' |
| 177 |
| 170 def additional_command_line_flags(self): | 178 def additional_command_line_flags(self): |
| 171 return ['--dump-render-tree', '--encode-binary'] | 179 return ['--dump-render-tree', '--encode-binary'] |
| 180 |
| 172 def device_directory(self): | 181 def device_directory(self): |
| 173 return DEVICE_SOURCE_ROOT_DIR + 'content_shell/' | 182 return DEVICE_SOURCE_ROOT_DIR + 'content_shell/' |
| 174 | 183 |
| 184 |
| 175 # The AndroidCommands class encapsulates commands to communicate with an attache
d device. | 185 # The AndroidCommands class encapsulates commands to communicate with an attache
d device. |
| 176 class AndroidCommands(object): | 186 class AndroidCommands(object): |
| 177 _adb_command_path = None | 187 _adb_command_path = None |
| 178 _adb_command_path_options = [] | 188 _adb_command_path_options = [] |
| 179 | 189 |
| 180 def __init__(self, executive, device_serial): | 190 def __init__(self, executive, device_serial): |
| 181 self._executive = executive | 191 self._executive = executive |
| 182 self._device_serial = device_serial | 192 self._device_serial = device_serial |
| 183 | 193 |
| 184 # Local public methods. | 194 # Local public methods. |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 return command | 1051 return command |
| 1042 | 1052 |
| 1043 def _read_prompt(self, deadline): | 1053 def _read_prompt(self, deadline): |
| 1044 last_char = '' | 1054 last_char = '' |
| 1045 while True: | 1055 while True: |
| 1046 current_char = self._server_process.read_stdout(deadline, 1) | 1056 current_char = self._server_process.read_stdout(deadline, 1) |
| 1047 if current_char == ' ': | 1057 if current_char == ' ': |
| 1048 if last_char in ('#', '$'): | 1058 if last_char in ('#', '$'): |
| 1049 return | 1059 return |
| 1050 last_char = current_char | 1060 last_char = current_char |
| OLD | NEW |