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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py

Issue 1663753002: Apply all blink changes between @202695 and tip of trunk (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/2454_1
Patch Set: Created 4 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/dart/V8Converter.cpp ('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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 failures = [] 318 failures = []
319 if (expected_audio and actual_audio and 319 if (expected_audio and actual_audio and
320 self._port.do_audio_results_differ(expected_audio, actual_audio)): 320 self._port.do_audio_results_differ(expected_audio, actual_audio)):
321 failures.append(test_failures.FailureAudioMismatch()) 321 failures.append(test_failures.FailureAudioMismatch())
322 elif actual_audio and not expected_audio: 322 elif actual_audio and not expected_audio:
323 failures.append(test_failures.FailureMissingAudio()) 323 failures.append(test_failures.FailureMissingAudio())
324 return failures 324 return failures
325 325
326 _observatory_cleaner = re.compile(r"^Observatory.*\n", re.MULTILINE) 326 _observatory_cleaner = re.compile(r"^Observatory.*\n", re.MULTILINE)
327 _console_observatory_cleaner = re.compile(r"^CONSOLE INFO: Observatory.*\n", re.MULTILINE) 327 _console_observatory_cleaner = re.compile(r"^CONSOLE INFO: Observatory.*\n", re.MULTILINE)
328 _line_number_cleaner = re.compile(r"\(dart:(\w+):\d+\)", re.MULTILINE)
329
330 def _line_number_substitution(self, match):
331 return "(dart:" + match.group(1) + ":xxxx)"
328 332
329 def _get_normalized_output_text(self, output): 333 def _get_normalized_output_text(self, output):
330 """Returns the normalized text output, i.e. the output in which 334 """Returns the normalized text output, i.e. the output in which
331 the end-of-line characters are normalized to "\n".""" 335 the end-of-line characters are normalized to "\n"."""
332 # Running tests on Windows produces "\r\n". The "\n" part is helpfully 336 # Running tests on Windows produces "\r\n". The "\n" part is helpfully
333 # changed to "\r\n" by our system (Python/Cygwin), resulting in 337 # changed to "\r\n" by our system (Python/Cygwin), resulting in
334 # "\r\r\n", when, in fact, we wanted to compare the text output with 338 # "\r\r\n", when, in fact, we wanted to compare the text output with
335 # the normalized text expectation files. 339 # the normalized text expectation files.
336 normalized_lines = output.replace("\r\r\n", "\r\n").replace("\r\n", "\n" ) 340 normalized_lines = output.replace("\r\r\n", "\r\n").replace("\r\n", "\n" )
337 normalized_lines = re.sub(self._observatory_cleaner, r"", normalized_lin es) 341 normalized_lines = re.sub(self._observatory_cleaner, r"", normalized_lin es)
338 normalized_lines = re.sub(self._console_observatory_cleaner, r"", normal ized_lines) 342 normalized_lines = re.sub(self._console_observatory_cleaner, r"", normal ized_lines)
343 normalized_lines = re.sub(self._line_number_cleaner, self._line_number_s ubstitution, normalized_lines)
339 return normalized_lines 344 return normalized_lines
340 345
341 # FIXME: This function also creates the image diff. Maybe that work should 346 # FIXME: This function also creates the image diff. Maybe that work should
342 # be handled elsewhere? 347 # be handled elsewhere?
343 def _compare_image(self, expected_driver_output, driver_output): 348 def _compare_image(self, expected_driver_output, driver_output):
344 failures = [] 349 failures = []
345 # If we didn't produce a hash file, this test must be text-only. 350 # If we didn't produce a hash file, this test must be text-only.
346 if driver_output.image_hash is None: 351 if driver_output.image_hash is None:
347 return failures 352 return failures
348 if not expected_driver_output.image: 353 if not expected_driver_output.image:
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 elif reference_driver_output.image_hash != actual_driver_output.image_ha sh: 441 elif reference_driver_output.image_hash != actual_driver_output.image_ha sh:
437 diff, err_str = self._port.diff_image(reference_driver_output.image, actual_driver_output.image) 442 diff, err_str = self._port.diff_image(reference_driver_output.image, actual_driver_output.image)
438 if diff: 443 if diff:
439 failures.append(test_failures.FailureReftestMismatch(reference_f ilename)) 444 failures.append(test_failures.FailureReftestMismatch(reference_f ilename))
440 elif err_str: 445 elif err_str:
441 _log.error(err_str) 446 _log.error(err_str)
442 else: 447 else:
443 _log.warning(" %s -> ref test hashes didn't match but diff pass ed" % self._test_name) 448 _log.warning(" %s -> ref test hashes didn't match but diff pass ed" % self._test_name)
444 449
445 return TestResult(self._test_name, failures, total_test_time, has_stderr , pid=actual_driver_output.pid) 450 return TestResult(self._test_name, failures, total_test_time, has_stderr , pid=actual_driver_output.pid)
OLDNEW
« no previous file with comments | « Source/bindings/core/dart/V8Converter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698