Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 [[MS_TRUETYPE_FONTS_DIR], 'Verdana_Italic.ttf', MS_TRUETYPE_FONTS_PACKAGE], 113 [[MS_TRUETYPE_FONTS_DIR], 'Verdana_Italic.ttf', MS_TRUETYPE_FONTS_PACKAGE],
114 # The Microsoft font EULA 114 # The Microsoft font EULA
115 [['/usr/share/doc/ttf-mscorefonts-installer/'], 'READ_ME!.gz', MS_TRUETYPE_F ONTS_PACKAGE], 115 [['/usr/share/doc/ttf-mscorefonts-installer/'], 'READ_ME!.gz', MS_TRUETYPE_F ONTS_PACKAGE],
116 # Other fonts: Arabic, CJK, Indic, Thai, etc. 116 # Other fonts: Arabic, CJK, Indic, Thai, etc.
117 [['/usr/share/fonts/truetype/ttf-dejavu/'], 'DejaVuSans.ttf', 'ttf-dejavu'], 117 [['/usr/share/fonts/truetype/ttf-dejavu/'], 'DejaVuSans.ttf', 'ttf-dejavu'],
118 [['/usr/share/fonts/truetype/kochi/'], 'kochi-mincho.ttf', 'ttf-kochi-mincho '], 118 [['/usr/share/fonts/truetype/kochi/'], 'kochi-mincho.ttf', 'ttf-kochi-mincho '],
119 [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'lohit_hi.ttf', 'ttf-i ndic-fonts-core'], 119 [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'lohit_hi.ttf', 'ttf-i ndic-fonts-core'],
120 [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'lohit_ta.ttf', 'ttf-i ndic-fonts-core'], 120 [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'lohit_ta.ttf', 'ttf-i ndic-fonts-core'],
121 [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'MuktiNarrow.ttf', 'tt f-indic-fonts-core'], 121 [['/usr/share/fonts/truetype/ttf-indic-fonts-core/'], 'MuktiNarrow.ttf', 'tt f-indic-fonts-core'],
122 [['/usr/share/fonts/truetype/thai/', '/usr/share/fonts/truetype/tlwg/'], 'Ga ruda.ttf', 'fonts-tlwg-garuda'], 122 [['/usr/share/fonts/truetype/thai/', '/usr/share/fonts/truetype/tlwg/'], 'Ga ruda.ttf', 'fonts-tlwg-garuda'],
123 [['/usr/share/fonts/truetype/ttf-indic-fonts-core/', '/usr/share/fonts/truet ype/ttf-punjabi-fonts/'], 'lohit_pa.ttf', 'ttf-indic-fonts-core'], 123 [['/usr/share/fonts/truetype/ttf-indic-fonts-core/',
124 '/usr/share/fonts/truetype/ttf-punjabi-fonts/'],
125 'lohit_pa.ttf',
126 'ttf-indic-fonts-core'],
124 ] 127 ]
125 128
126 # Test resources that need to be accessed as files directly. 129 # Test resources that need to be accessed as files directly.
127 # Each item can be the relative path of a directory or a file. 130 # Each item can be the relative path of a directory or a file.
128 TEST_RESOURCES_TO_PUSH = [ 131 TEST_RESOURCES_TO_PUSH = [
129 # Blob tests need to access files directly. 132 # Blob tests need to access files directly.
130 'editing/pasteboard/resources', 133 'editing/pasteboard/resources',
131 'fast/files/resources', 134 'fast/files/resources',
132 'http/tests/local/resources', 135 'http/tests/local/resources',
133 'http/tests/local/formdata/resources', 136 'http/tests/local/formdata/resources',
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 return AndroidCommands._adb_command_path 281 return AndroidCommands._adb_command_path
279 282
280 assert AndroidCommands._adb_command_path_options, 'No commands paths hav e been set to look for the "adb" command.' 283 assert AndroidCommands._adb_command_path_options, 'No commands paths hav e been set to look for the "adb" command.'
281 284
282 command_path = None 285 command_path = None
283 command_version = None 286 command_version = None
284 for path_option in AndroidCommands._adb_command_path_options: 287 for path_option in AndroidCommands._adb_command_path_options:
285 path_version = AndroidCommands._determine_adb_version(path_option, e xecutive, debug_logging) 288 path_version = AndroidCommands._determine_adb_version(path_option, e xecutive, debug_logging)
286 if not path_version: 289 if not path_version:
287 continue 290 continue
288 if command_version != None and path_version < command_version: 291 if command_version is not None and path_version < command_version:
289 continue 292 continue
290 293
291 command_path = path_option 294 command_path = path_option
292 command_version = path_version 295 command_version = path_version
293 296
294 assert command_path, 'Unable to locate the "adb" command. Are you using an Android checkout of Chromium?' 297 assert command_path, 'Unable to locate the "adb" command. Are you using an Android checkout of Chromium?'
295 298
296 AndroidCommands._adb_command_path = command_path 299 AndroidCommands._adb_command_path = command_path
297 return command_path 300 return command_path
298 301
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 def path_to_forwarder(self): 459 def path_to_forwarder(self):
457 return self._build_path('forwarder') 460 return self._build_path('forwarder')
458 461
459 def path_to_md5sum(self): 462 def path_to_md5sum(self):
460 return self._build_path(MD5SUM_DEVICE_FILE_NAME) 463 return self._build_path(MD5SUM_DEVICE_FILE_NAME)
461 464
462 def path_to_md5sum_host(self): 465 def path_to_md5sum_host(self):
463 return self._build_path(MD5SUM_HOST_FILE_NAME) 466 return self._build_path(MD5SUM_HOST_FILE_NAME)
464 467
465 def additional_driver_flag(self): 468 def additional_driver_flag(self):
466 return super(AndroidPort, self).additional_driver_flag() + self._driver_ details.additional_command_line_flags(use_breakpad=not self.get_option('disable_ breakpad')) 469 return super(AndroidPort, self).additional_driver_flag() + \
470 self._driver_details.additional_command_line_flags(use_breakpad=not self.get_option('disable_breakpad'))
467 471
468 def default_timeout_ms(self): 472 def default_timeout_ms(self):
469 # Android platform has less computing power than desktop platforms. 473 # Android platform has less computing power than desktop platforms.
470 # Using 10 seconds allows us to pass most slow tests which are not 474 # Using 10 seconds allows us to pass most slow tests which are not
471 # marked as slow tests on desktop platforms. 475 # marked as slow tests on desktop platforms.
472 return 10 * 1000 476 return 10 * 1000
473 477
474 def driver_stop_timeout(self): 478 def driver_stop_timeout(self):
475 # The driver doesn't respond to closing stdin, so we might as well stop the driver immediately. 479 # The driver doesn't respond to closing stdin, so we might as well stop the driver immediately.
476 return 0.0 480 return 0.0
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 export GYP_DEFINES="profiling=1 $GYP_DEFINES" 723 export GYP_DEFINES="profiling=1 $GYP_DEFINES"
720 update-webkit --chromium-android 724 update-webkit --chromium-android
721 build-webkit --chromium-android 725 build-webkit --chromium-android
722 726
723 Googlers should read: 727 Googlers should read:
724 http://goto.google.com/cr-android-perf-howto 728 http://goto.google.com/cr-android-perf-howto
725 """) 729 """)
726 730
727 def attach_to_pid(self, pid): 731 def attach_to_pid(self, pid):
728 assert(pid) 732 assert(pid)
729 assert(self._perf_process == None) 733 assert(self._perf_process is None)
730 # FIXME: This can't be a fixed timeout! 734 # FIXME: This can't be a fixed timeout!
731 cmd = self._android_commands.adb_command() + ['shell', 'perf', 'record', '-g', '-p', pid, 'sleep', 30] 735 cmd = self._android_commands.adb_command() + ['shell', 'perf', 'record', '-g', '-p', pid, 'sleep', 30]
732 self._perf_process = self._host.executive.popen(cmd) 736 self._perf_process = self._host.executive.popen(cmd)
733 737
734 def _perf_version_string(self, perf_path): 738 def _perf_version_string(self, perf_path):
735 try: 739 try:
736 return self._host.executive.run_command([perf_path, '--version']) 740 return self._host.executive.run_command([perf_path, '--version'])
737 except: 741 except:
738 return None 742 return None
739 743
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 self._forwarder_process.start() 1146 self._forwarder_process.start()
1143 1147
1144 deadline = time.time() + DRIVER_START_STOP_TIMEOUT_SECS 1148 deadline = time.time() + DRIVER_START_STOP_TIMEOUT_SECS
1145 if not self._wait_for_server_process_output(self._forwarder_process, dea dline, 'Forwarding device port'): 1149 if not self._wait_for_server_process_output(self._forwarder_process, dea dline, 'Forwarding device port'):
1146 return False 1150 return False
1147 1151
1148 self._android_commands.run(['logcat', '-c']) 1152 self._android_commands.run(['logcat', '-c'])
1149 1153
1150 cmd_line_file_path = self._driver_details.command_line_file() 1154 cmd_line_file_path = self._driver_details.command_line_file()
1151 original_cmd_line_file_path = cmd_line_file_path + '.orig' 1155 original_cmd_line_file_path = cmd_line_file_path + '.orig'
1152 if self._android_commands.file_exists(cmd_line_file_path) and not self._ android_commands.file_exists(original_cmd_line_file_path): 1156 if self._android_commands.file_exists(
1157 cmd_line_file_path) and not self._android_commands.file_exists(o riginal_cmd_line_file_path):
1153 # We check for both the normal path and the backup because we do not want to step 1158 # We check for both the normal path and the backup because we do not want to step
1154 # on the backup. Otherwise, we'd clobber the backup whenever we chan ged the 1159 # on the backup. Otherwise, we'd clobber the backup whenever we chan ged the
1155 # command line during the run. 1160 # command line during the run.
1156 self._android_commands.run(['shell', 'mv', cmd_line_file_path, origi nal_cmd_line_file_path]) 1161 self._android_commands.run(['shell', 'mv', cmd_line_file_path, origi nal_cmd_line_file_path])
1157 1162
1158 self._android_commands.run(['shell', 'echo'] + self._android_driver_cmd_ line(pixel_tests, 1163 self._android_commands.run(['shell', 'echo'] + self._android_driver_cmd_ line(pixel_tests,
1159 per_test_args) + ['>', self._driver_details.command_line_file()]) 1164 per_test_args) + ['>', self._driver_details.command_line_file()])
1160 self._created_cmd_line = True 1165 self._created_cmd_line = True
1161 1166
1162 self._android_commands.run(['shell', 'rm', '-rf', self._driver_details.d evice_crash_dumps_directory()]) 1167 self._android_commands.run(['shell', 'rm', '-rf', self._driver_details.d evice_crash_dumps_directory()])
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 return command 1306 return command
1302 1307
1303 def _read_prompt(self, deadline): 1308 def _read_prompt(self, deadline):
1304 last_char = '' 1309 last_char = ''
1305 while True: 1310 while True:
1306 current_char = self._server_process.read_stdout(deadline, 1) 1311 current_char = self._server_process.read_stdout(deadline, 1)
1307 if current_char == ' ': 1312 if current_char == ' ':
1308 if last_char in ('#', '$'): 1313 if last_char in ('#', '$'):
1309 return 1314 return
1310 last_char = current_char 1315 last_char = current_char
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698