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

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

Issue 303223008: Overlay expected and actual repaint rects for LayoutTests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add several small features Created 6 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 | Annotate | Revision Log
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 13 matching lines...) Expand all
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 29
30 import logging 30 import logging
31 import re 31 import re
32 import time 32 import time
33 33
34 from webkitpy.layout_tests.controllers import repaint_overlay
34 from webkitpy.layout_tests.controllers import test_result_writer 35 from webkitpy.layout_tests.controllers import test_result_writer
35 from webkitpy.layout_tests.port.driver import DeviceFailure, DriverInput, Driver Output 36 from webkitpy.layout_tests.port.driver import DeviceFailure, DriverInput, Driver Output
36 from webkitpy.layout_tests.models import test_expectations 37 from webkitpy.layout_tests.models import test_expectations
37 from webkitpy.layout_tests.models import test_failures 38 from webkitpy.layout_tests.models import test_failures
38 from webkitpy.layout_tests.models.test_results import TestResult 39 from webkitpy.layout_tests.models.test_results import TestResult
39 40
40 41
41 _log = logging.getLogger(__name__) 42 _log = logging.getLogger(__name__)
42 43
43 44
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 243
243 is_testharness_test, testharness_failures = self._compare_testharness_te st(driver_output, expected_driver_output) 244 is_testharness_test, testharness_failures = self._compare_testharness_te st(driver_output, expected_driver_output)
244 if is_testharness_test: 245 if is_testharness_test:
245 failures.extend(testharness_failures) 246 failures.extend(testharness_failures)
246 else: 247 else:
247 failures.extend(self._compare_text(expected_driver_output.text, driv er_output.text)) 248 failures.extend(self._compare_text(expected_driver_output.text, driv er_output.text))
248 failures.extend(self._compare_audio(expected_driver_output.audio, dr iver_output.audio)) 249 failures.extend(self._compare_audio(expected_driver_output.audio, dr iver_output.audio))
249 if self._should_run_pixel_test: 250 if self._should_run_pixel_test:
250 failures.extend(self._compare_image(expected_driver_output, driv er_output)) 251 failures.extend(self._compare_image(expected_driver_output, driv er_output))
251 return TestResult(self._test_name, failures, driver_output.test_time, dr iver_output.has_stderr(), 252 return TestResult(self._test_name, failures, driver_output.test_time, dr iver_output.has_stderr(),
252 pid=driver_output.pid) 253 pid=driver_output.pid,
254 has_repaint_overlay=repaint_overlay.result_contains_re paint_rects(expected_driver_output.text))
253 255
254 def _compare_testharness_test(self, driver_output, expected_driver_output): 256 def _compare_testharness_test(self, driver_output, expected_driver_output):
255 if expected_driver_output.image or expected_driver_output.audio or expec ted_driver_output.text: 257 if expected_driver_output.image or expected_driver_output.audio or expec ted_driver_output.text:
256 return False, [] 258 return False, []
257 259
258 if driver_output.image or driver_output.audio or self._is_render_tree(dr iver_output.text): 260 if driver_output.image or driver_output.audio or self._is_render_tree(dr iver_output.text):
259 return False, [] 261 return False, []
260 262
261 failures = [] 263 failures = []
262 found_a_pass = False 264 found_a_pass = False
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 elif reference_driver_output.image_hash != actual_driver_output.image_ha sh: 409 elif reference_driver_output.image_hash != actual_driver_output.image_ha sh:
408 diff, err_str = self._port.diff_image(reference_driver_output.image, actual_driver_output.image) 410 diff, err_str = self._port.diff_image(reference_driver_output.image, actual_driver_output.image)
409 if diff: 411 if diff:
410 failures.append(test_failures.FailureReftestMismatch(reference_f ilename)) 412 failures.append(test_failures.FailureReftestMismatch(reference_f ilename))
411 elif err_str: 413 elif err_str:
412 _log.error(err_str) 414 _log.error(err_str)
413 else: 415 else:
414 _log.warning(" %s -> ref test hashes didn't match but diff pass ed" % self._test_name) 416 _log.warning(" %s -> ref test hashes didn't match but diff pass ed" % self._test_name)
415 417
416 return TestResult(self._test_name, failures, total_test_time, has_stderr , pid=actual_driver_output.pid) 418 return TestResult(self._test_name, failures, total_test_time, has_stderr , pid=actual_driver_output.pid)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698