Changeset 136158 in webkit
- Timestamp:
- Nov 29, 2012, 1:27:32 PM (14 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/layout_tests/port/chromium_android.py (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r136152 r136158 1 2012-11-29 Peter Beverloo <peter@chromium.org> 2 3 run-perf-tests --chromium-android should not require adb in my path 4 https://bugs.webkit.org/show_bug.cgi?id=103581 5 6 Reviewed by Eric Seidel. 7 8 Remove the need to have "adb" available in the path for Layout and Performance 9 tests. We'll determine the versions of the "adb" version in path (if any) and 10 the one provided in the Chromium Android checkout. Unless the "adb" available 11 in the path is newer, the provided version will be used. 12 13 Some other minor nits addressed: 14 - The path_to_forwarder/path_to_md5sum should not be in the "private overrides" 15 section, as they're not overriding anything and are used by the driver. 16 - Make _restart_adb_as_root slightly more robust by waiting for the device 17 to come back online regardless of the output. 18 19 * Scripts/webkitpy/layout_tests/port/chromium_android.py: 20 (ChromiumAndroidPort.__init__): 21 (ChromiumAndroidPort.check_build): 22 (ChromiumAndroidPort.path_to_adb): 23 (ChromiumAndroidPort): 24 (ChromiumAndroidPort.path_to_forwarder): 25 (ChromiumAndroidPort.path_to_md5sum): 26 (ChromiumAndroidPort._path_to_helper): 27 (ChromiumAndroidPort._determine_adb_version): 28 (ChromiumAndroidPort._get_devices): 29 (ChromiumAndroidDriver.__init__): 30 (ChromiumAndroidDriver._setup_md5sum_and_push_data_if_needed): 31 (ChromiumAndroidDriver._push_executable): 32 (ChromiumAndroidDriver._restart_adb_as_root): 33 1 34 2012-11-29 Martin Robinson <mrobinson@igalia.com> 2 35 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py
r135930 r136158 33 33 import re 34 34 import subprocess 35 import sys 35 36 import threading 36 37 import time … … 43 44 44 45 _log = logging.getLogger(__name__) 45 46 46 47 47 # The root directory for test resources, which has the same structure as the … … 156 156 port_name = 'chromium-android' 157 157 158 # Avoid initializing the adb path [worker count]+1 times by storing it as a static member. 159 _adb_path = None 160 158 161 FALLBACK_PATHS = [ 159 162 'chromium-android', … … 209 212 def check_build(self, needs_http): 210 213 result = super(ChromiumAndroidPort, self).check_build(needs_http) 211 result = self._check_file_exists(self. _path_to_md5sum(), 'md5sum utility') and result212 result = self._check_file_exists(self. _path_to_forwarder(), 'forwarder utility') and result214 result = self._check_file_exists(self.path_to_md5sum(), 'md5sum utility') and result 215 result = self._check_file_exists(self.path_to_forwarder(), 'forwarder utility') and result 213 216 if not result: 214 217 _log.error('For complete Android build requirements, please see:') … … 261 264 return self.create_driver(0)._drt_cmd_line(self.get_option('pixel_tests'), []) 262 265 266 def path_to_adb(self): 267 if ChromiumAndroidPort._adb_path: 268 return ChromiumAndroidPort._adb_path 269 270 provided_adb_path = self.path_from_chromium_base('third_party', 'android_tools', 'sdk', 'platform-tools', 'adb') 271 272 path_version = self._determine_adb_version('adb') 273 provided_version = self._determine_adb_version(provided_adb_path) 274 assert provided_version, 'The checked in Android SDK is missing. Are you sure you ran update-webkit --chromium-android?' 275 276 if not path_version: 277 ChromiumAndroidPort._adb_path = provided_adb_path 278 elif provided_version > path_version: 279 # FIXME: The Printer isn't initialized when this is called, so using _log would just show an unitialized logger error. 280 print >> sys.stderr, 'The "adb" version in your path is older than the one checked in, consider updating your local Android SDK. Using the checked in one.' 281 ChromiumAndroidPort._adb_path = provided_adb_path 282 else: 283 ChromiumAndroidPort._adb_path = 'adb' 284 285 return ChromiumAndroidPort._adb_path 286 287 def path_to_forwarder(self): 288 return self._build_path('forwarder') 289 290 def path_to_md5sum(self): 291 return self._build_path(MD5SUM_DEVICE_FILE_NAME) 292 263 293 # Overridden private functions. 264 294 … … 281 311 return None 282 312 283 def _path_to_forwarder(self):284 return self._build_path('forwarder')285 286 def _path_to_md5sum(self):287 return self._build_path(MD5SUM_DEVICE_FILE_NAME)288 289 313 def _path_to_image_diff(self): 290 314 return self._host_port._path_to_image_diff() … … 309 333 310 334 # Local private functions. 335 336 def _determine_adb_version(self, adb_path): 337 re_version = re.compile('^.*version ([\d\.]+)$') 338 try: 339 output = self._executive.run_command([adb_path, 'version'], error_handler=self._executive.ignore_error) 340 except OSError: 341 return None 342 result = re_version.match(output) 343 if not output or not result: 344 return None 345 return [int(n) for n in result.group(1).split('.')] 311 346 312 347 def _get_devices(self): 313 348 if not self._devices: 314 349 re_device = re.compile('^([a-zA-Z0-9_:.-]+)\tdevice$', re.MULTILINE) 315 result = self._executive.run_command([ 'adb', 'devices'], error_handler=self._executive.ignore_error)350 result = self._executive.run_command([self.path_to_adb(), 'devices'], error_handler=self._executive.ignore_error) 316 351 self._devices = re_device.findall(result) 317 352 if not self._devices: … … 339 374 self._original_governors = {} 340 375 self._device_serial = port._get_device_serial(worker_number) 341 self._adb_command = [ 'adb', '-s', self._device_serial]376 self._adb_command = [port.path_to_adb(), '-s', self._device_serial] 342 377 343 378 def __del__(self): … … 346 381 347 382 def _setup_md5sum_and_push_data_if_needed(self): 348 self._md5sum_path = self._port. _path_to_md5sum()383 self._md5sum_path = self._port.path_to_md5sum() 349 384 if not self._file_exists_on_device(MD5SUM_DEVICE_PATH): 350 385 if not self._push_to_device(self._md5sum_path, MD5SUM_DEVICE_PATH): … … 404 439 405 440 def _push_executable(self): 406 self._push_file_if_needed(self._port. _path_to_forwarder(), DEVICE_FORWARDER_PATH)441 self._push_file_if_needed(self._port.path_to_forwarder(), DEVICE_FORWARDER_PATH) 407 442 self._push_file_if_needed(self._port._build_path('DumpRenderTree.pak'), DEVICE_DRT_DIR + 'DumpRenderTree.pak') 408 443 self._push_file_if_needed(self._port._build_path('DumpRenderTree_resources'), DEVICE_DRT_DIR + 'DumpRenderTree_resources') … … 434 469 if 'adbd is already running as root' in output: 435 470 return 436 elif 'restarting adbd as root' in output: 437 self._run_adb_command(['wait-for-device']) 438 else: 471 elif not 'restarting adbd as root' in output: 439 472 self._log_error('Unrecognized output from adb root: %s' % output) 473 474 # Regardless the output, give the device a moment to come back online. 475 self._run_adb_command(['wait-for-device']) 440 476 441 477 def _run_adb_command(self, cmd, ignore_error=False):
Note:
See TracChangeset
for help on using the changeset viewer.