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

Issue 174073002: Overlay expected and actual repaint rects for LayoutTests. (Closed)

Created:
6 years, 10 months ago by dsinclair
Modified:
6 years, 6 months ago
Reviewers:
Dirk Pranke, esprehn, ojan
CC:
blink-reviews
Visibility:
Public.

Description

Overlay expected and actual repaint rects for LayoutTests. For the new world of text based repaint tests it can be hard to visualize how the repaint rects appear on the screen. This is a first pass at visualizing the difference between the old and new repaint rects when one of the text based repaint tests fail. BUG=

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -5 lines) Patch
M LayoutTests/fast/harness/results.html View 6 chunks +12 lines, -4 lines 2 comments Download
M Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py View 1 4 chunks +130 lines, -1 line 6 comments Download

Messages

Total messages: 8 (0 generated)
dsinclair
esprehn, PTAL. Talking to jamesr@ he mentioned that you maybe interested in this. I wanted ...
6 years, 10 months ago (2014-02-21 01:54:06 UTC) #1
esprehn
Yeah this is what I was hoping for, lets finish this up and land it. ...
6 years, 10 months ago (2014-02-21 02:00:58 UTC) #2
dsinclair
https://codereview.chromium.org/174073002/diff/1/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py File Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py (right): https://codereview.chromium.org/174073002/diff/1/Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py#newcode274 Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:274: var overlay = document.querySelector('.overlay'); On 2014/02/21 02:00:59, esprehn wrote: ...
6 years, 10 months ago (2014-02-21 02:24:55 UTC) #3
dsinclair
ping.
6 years, 10 months ago (2014-02-24 21:14:08 UTC) #4
esprehn
lgtm to me, but I don't think I can approve stuff in Source/Tools, ojan and ...
6 years, 10 months ago (2014-02-24 22:24:13 UTC) #5
Dirk Pranke
On 2014/02/24 22:24:13, esprehn wrote: > lgtm to me, but I don't think I can ...
6 years, 10 months ago (2014-02-24 23:31:34 UTC) #6
ojan
This needs a test. See LayoutTests/fast/harness/resources/results-test.js. It's just run as a regular layout test. The ...
6 years, 10 months ago (2014-02-25 00:43:42 UTC) #7
Dirk Pranke
6 years, 9 months ago (2014-02-27 20:57:44 UTC) #8
The general idea, while a bit painful, seems fine.

We need  unit tests for both the python change and the results.html change;
splitting the python change out into a separate file should make the former easy
enough.

I've added a couple of comments on the coding style. I didn't see any outright
bugs, so add the tests and this be lgt'able.

https://codereview.chromium.org/174073002/diff/60001/LayoutTests/fast/harness...
File LayoutTests/fast/harness/results.html (right):

https://codereview.chromium.org/174073002/diff/60001/LayoutTests/fast/harness...
LayoutTests/fast/harness/results.html:537: html += resultLink(prefix,
'-overlay.html?' + encodeURIComponent(testLinkTarget(test)), 'overlay');
On 2014/02/25 00:43:42, ojan wrote:
> It's a bit of a bummer to have the (broken) overlay links even for non-repaint
> tests. Can we add a bit to the json (e.g. like has_wdiff) for repaint tests?

Agreed. I don't want to display a link that is irrelevant.

https://codereview.chromium.org/174073002/diff/60001/Tools/Scripts/webkitpy/l...
File Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py
(right):

https://codereview.chromium.org/174073002/diff/60001/Tools/Scripts/webkitpy/l...
Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:208: def
create_overlay_invalidation_result(self, actual_text, expected_text):
Can you pull this whole function out of this file and create a new file for it?
I would like to keep it separate from the other logic in this file (we should do
that for write_image_diff_files, as well, but not as part of this change).

https://codereview.chromium.org/174073002/diff/60001/Tools/Scripts/webkitpy/l...
Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:210:
repaintMatch = repaintPattern.search(expected_text)
this can probably be just re.search('^\(repaint rects$', expected_text).

compilling the re doesn't buy you anything if you're only going to use re once
in the function and recompile it every time.

https://codereview.chromium.org/174073002/diff/60001/Tools/Scripts/webkitpy/l...
Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:218: for m
in re.finditer(rect_pattern, input_str):
hm. didn't know about finditer(); nifty.

https://codereview.chromium.org/174073002/diff/60001/Tools/Scripts/webkitpy/l...
Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:227:
return ret + ']'
hm. didn't know about finditer(); nifty.

This can probably be written as 

def make_js_rect(input_str):
    rect_pattern = '\(rect\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\)'
    rects = []
    for m in re.finditer(rect_pattern, input_str):
        rects.append('[' + ','.join(m.groups()) + ']')
    return '[' + ','.join(rects) + ']'

(You could probably do it w/ a nested list comprehension or two, even, but I
wouldn't).

https://codereview.chromium.org/174073002/diff/60001/Tools/Scripts/webkitpy/l...
Tools/Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:232: html
= """<!DOCTYPE HTML>
I defer to ojan re: the html template, but it looks more or less plausible to me
:).

Powered by Google App Engine
This is Rietveld 408576698