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

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

Issue 2525033003: Display content_shell error messages. (Closed)
Patch Set: Created 4 years 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) 2011 Google Inc. All rights reserved. 1 # Copyright (C) 2011 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 17 matching lines...) Expand all
28 28
29 import base64 29 import base64
30 import logging 30 import logging
31 import re 31 import re
32 import shlex 32 import shlex
33 import sys 33 import sys
34 import time 34 import time
35 35
36 from webkitpy.common.system import path 36 from webkitpy.common.system import path
37 from webkitpy.common.system.profiler import ProfilerFactory 37 from webkitpy.common.system.profiler import ProfilerFactory
38 from webkitpy.layout_tests.port.server_process import quote_data
38 39
39 40
40 _log = logging.getLogger(__name__) 41 _log = logging.getLogger(__name__)
41 42
42 43
43 DRIVER_START_TIMEOUT_SECS = 30 44 DRIVER_START_TIMEOUT_SECS = 30
44 45
45 46
46 class DriverInput(object): 47 class DriverInput(object):
47 48
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 _log.error("content_shell took too long to startup.") 331 _log.error("content_shell took too long to startup.")
331 332
332 def _wait_for_server_process_output(self, server_process, deadline, text): 333 def _wait_for_server_process_output(self, server_process, deadline, text):
333 output = '' 334 output = ''
334 line = server_process.read_stdout_line(deadline) 335 line = server_process.read_stdout_line(deadline)
335 while not server_process.timed_out and not server_process.has_crashed() and not text in line.rstrip(): 336 while not server_process.timed_out and not server_process.has_crashed() and not text in line.rstrip():
336 output += line 337 output += line
337 line = server_process.read_stdout_line(deadline) 338 line = server_process.read_stdout_line(deadline)
338 339
339 if server_process.timed_out or server_process.has_crashed(): 340 if server_process.timed_out or server_process.has_crashed():
341 # Print stdout and stderr if the process failed to start.
342 # Adapted from ServerProcess._log_data().
343 for line in quote_data(output):
344 _log.error('%s: %s', 'OUT', line)
345 for line in quote_data(server_process.pop_all_buffered_stderr()):
346 _log.error('%s: %s', 'ERR', line)
340 _log.error('Failed to start the %s process: \n%s', server_process.na me(), output) 347 _log.error('Failed to start the %s process: \n%s', server_process.na me(), output)
Dirk Pranke 2016/11/29 02:20:48 Doesn't this result in double-logging things, sinc
Jack Bates 2016/12/01 17:47:38 Oops! Yes. How did I miss that? Thank you. I uploa
341 return False 348 return False
342 349
343 return True 350 return True
344 351
345 def _run_post_start_tasks(self): 352 def _run_post_start_tasks(self):
346 # Remote drivers may override this to delay post-start tasks until the s erver has ack'd. 353 # Remote drivers may override this to delay post-start tasks until the s erver has ack'd.
347 if self._profiler: 354 if self._profiler:
348 self._profiler.attach_to_pid(self._pid_on_target()) 355 self._profiler.attach_to_pid(self._pid_on_target())
349 356
350 def _pid_on_target(self): 357 def _pid_on_target(self):
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 self.decoded_content = None 551 self.decoded_content = None
545 self.malloc = None 552 self.malloc = None
546 self.js_heap = None 553 self.js_heap = None
547 self.stdin_path = None 554 self.stdin_path = None
548 555
549 def decode_content(self): 556 def decode_content(self):
550 if self.encoding == 'base64' and self.content is not None: 557 if self.encoding == 'base64' and self.content is not None:
551 self.decoded_content = base64.b64decode(self.content) 558 self.decoded_content = base64.b64decode(self.content)
552 else: 559 else:
553 self.decoded_content = self.content 560 self.decoded_content = self.content
OLDNEW
« content/shell/app/shell_main_delegate.cc ('K') | « content/shell/app/shell_main_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698