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

Side by Side Diff: sky/tools/webkitpy/layout_tests/controllers/single_test_runner.py

Issue 1107803002: Add Observatory to sky dart_controller (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « sky/engine/core/script/monitor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 def _compare_audio(self, expected_audio, actual_audio): 301 def _compare_audio(self, expected_audio, actual_audio):
302 failures = [] 302 failures = []
303 if (expected_audio and actual_audio and 303 if (expected_audio and actual_audio and
304 self._port.do_audio_results_differ(expected_audio, actual_audio)): 304 self._port.do_audio_results_differ(expected_audio, actual_audio)):
305 failures.append(test_failures.FailureAudioMismatch()) 305 failures.append(test_failures.FailureAudioMismatch())
306 elif actual_audio and not expected_audio: 306 elif actual_audio and not expected_audio:
307 failures.append(test_failures.FailureMissingAudio()) 307 failures.append(test_failures.FailureMissingAudio())
308 return failures 308 return failures
309 309
310 # FIXME: This won't be needed once we have flags for Sky that suppress the
311 # Observatory messages.
312 _filter_observatory_messages = re.compile(r"^CONSOLE: Observatory listening on.*\n", re.MULTILINE)
313
310 def _get_normalized_output_text(self, output): 314 def _get_normalized_output_text(self, output):
311 """Returns the normalized text output, i.e. the output in which 315 """Returns the normalized text output, i.e. the output in which
312 the end-of-line characters are normalized to "\n".""" 316 the end-of-line characters are normalized to "\n"."""
313 # Running tests on Windows produces "\r\n". The "\n" part is helpfully 317 # Running tests on Windows produces "\r\n". The "\n" part is helpfully
314 # changed to "\r\n" by our system (Python/Cygwin), resulting in 318 # changed to "\r\n" by our system (Python/Cygwin), resulting in
315 # "\r\r\n", when, in fact, we wanted to compare the text output with 319 # "\r\r\n", when, in fact, we wanted to compare the text output with
316 # the normalized text expectation files. 320 # the normalized text expectation files.
317 return output.replace("\r\r\n", "\r\n").replace("\r\n", "\n") 321 normalized_lines = output.replace("\r\r\n", "\r\n").replace("\r\n", "\n" )
322 normalized_lines = re.sub(self._filter_observatory_messages, r"", normal ized_lines)
323 return normalized_lines
318 324
319 # FIXME: This function also creates the image diff. Maybe that work should 325 # FIXME: This function also creates the image diff. Maybe that work should
320 # be handled elsewhere? 326 # be handled elsewhere?
321 def _compare_image(self, expected_driver_output, driver_output): 327 def _compare_image(self, expected_driver_output, driver_output):
322 failures = [] 328 failures = []
323 # If we didn't produce a hash file, this test must be text-only. 329 # If we didn't produce a hash file, this test must be text-only.
324 if driver_output.image_hash is None: 330 if driver_output.image_hash is None:
325 return failures 331 return failures
326 if not expected_driver_output.image: 332 if not expected_driver_output.image:
327 failures.append(test_failures.FailureMissingImage()) 333 failures.append(test_failures.FailureMissingImage())
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 _log.error(err_str) 415 _log.error(err_str)
410 416
411 else: 417 else:
412 diff, err_str = self._port.diff_image(reference_driver_output.image, actual_driver_output.image) 418 diff, err_str = self._port.diff_image(reference_driver_output.image, actual_driver_output.image)
413 if diff: 419 if diff:
414 failures.append(test_failures.FailureReftestMismatch(reference_f ilename)) 420 failures.append(test_failures.FailureReftestMismatch(reference_f ilename))
415 elif err_str: 421 elif err_str:
416 _log.error(err_str) 422 _log.error(err_str)
417 423
418 return TestResult(self._test_name, failures, total_test_time, has_stderr , pid=actual_driver_output.pid) 424 return TestResult(self._test_name, failures, total_test_time, has_stderr , pid=actual_driver_output.pid)
OLDNEW
« no previous file with comments | « sky/engine/core/script/monitor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698