Bug 100584 - Add support for text-based repaint testing
Summary: Add support for text-based repaint testing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: vollick
URL:
Keywords:
: 99480 (view as bug list)
Depends on:
Blocks: 97801
  Show dependency treegraph
 
Reported: 2012-10-26 18:56 PDT by vollick
Modified: 2012-11-01 16:45 PDT (History)
11 users (show)

See Also:


Attachments
Patch (39.20 KB, patch)
2012-10-26 19:11 PDT, vollick
no flags Details | Formatted Diff | Diff
Patch (39.12 KB, patch)
2012-10-30 10:49 PDT, vollick
no flags Details | Formatted Diff | Diff
Patch (34.59 KB, patch)
2012-10-30 13:17 PDT, vollick
no flags Details | Formatted Diff | Diff
Patch (34.57 KB, patch)
2012-10-30 14:04 PDT, vollick
no flags Details | Formatted Diff | Diff
Patch (34.50 KB, patch)
2012-10-31 05:46 PDT, vollick
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vollick 2012-10-26 18:56:08 PDT
Repaint testing is currently done using testRunner.display(), which ultimately requires brittle pixel comparisons. Ideally, we would be able to dump the repaint rects as text (which would hopefully be more consistent across ports).
Comment 1 vollick 2012-10-26 19:11:58 PDT
Created attachment 171070 [details]
Patch

Initial revision -- windows build and layout tests will likely fail.
Comment 2 Build Bot 2012-10-26 19:36:15 PDT
Comment on attachment 171070 [details]
Patch

Attachment 171070 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/14613285
Comment 3 EFL EWS Bot 2012-10-26 19:41:43 PDT
Comment on attachment 171070 [details]
Patch

Attachment 171070 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/14612250
Comment 4 Build Bot 2012-10-26 19:44:00 PDT
Comment on attachment 171070 [details]
Patch

Attachment 171070 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14603554
Comment 5 kov's GTK+ EWS bot 2012-10-26 20:07:16 PDT
Comment on attachment 171070 [details]
Patch

Attachment 171070 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/14606326
Comment 6 Raphael Kubo da Costa (:rakuco) 2012-10-29 02:15:05 PDT
Please see bug 99480 as well.
Comment 7 Sami Kyöstilä 2012-10-29 03:47:44 PDT
Comment on attachment 171070 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171070&action=review

Great stuff! This conflicts a bit with the patch in bug 97801, right? Maybe we should land that one first to get the foundation in place.

> LayoutTests/fast/repaint/canvas-putImageData-expected.txt:1
> + (repaint rects

Any idea where the extra space at the start of the line is coming from and is it expected? The other test doesn't seem to have it.

> LayoutTests/fast/repaint/canvas-putImageData.html:-3
> -    <script src="resources/repaint.js"></script>

We can't delete repaint.js yet, but it might be worth adding a comment banner there saying that pixel repaint tests are deprecated.
Comment 8 Sami Kyöstilä 2012-10-29 07:47:36 PDT
(In reply to comment #7)
> This conflicts a bit with the patch in bug 97801, right? Maybe we should land that one first to get the foundation in place.

Ah, I only now realized that this is the FrameView-part of that patch split off, right? Never mind.
Comment 9 vollick 2012-10-30 10:49:51 PDT
Created attachment 171484 [details]
Patch

This revision should hopefully pass on mac/chromium. Should fail on win.
Comment 10 Simon Fraser (smfr) 2012-10-30 10:55:37 PDT
Comment on attachment 171484 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=171484&action=review

> Source/WebCore/ChangeLog:33
> +        * WebCore.exp.in:
> +        * page/Frame.cpp:
> +        (WebCore::Frame::trackedRepaintRectsAsText):
> +        (WebCore):
> +        * page/Frame.h:
> +        (Frame):
> +        * page/FrameView.cpp:
> +        (WebCore::FrameView::setTracksRepaints):
> +        (WebCore::FrameView::resetTrackedRepaints):
> +        (WebCore):
> +        (WebCore::FrameView::trackedRepaintRectsAsText):
> +        * page/FrameView.h:
> +        (FrameView):
> +        * testing/Internals.cpp:
> +        (WebCore::Internals::repaintRectsAsText):
> +        (WebCore):
> +        (WebCore::Internals::startTrackingRepaints):
> +        (WebCore::Internals::stopTrackingRepaints):
> +        * testing/Internals.h:
> +        * testing/Internals.idl:

You should remove redundant lines, and annotate the method to describe the changes you made.

> Source/WebCore/testing/Internals.cpp:1414
> +    frameView->setTracksRepaints(true);
> +    frameView->resetTrackedRepaints();

These two lines are all over the place. If this is the contract (that starting tracking clears existing), then the reset should be moved to the FrameView code.

> Source/WebCore/testing/Internals.idl:204
> +    void startTrackingRepaints(in Document document) raises (DOMException);
> +    void stopTrackingRepaints(in Document document) raises (DOMException);

It's not clear whether starting clears previous rects, and whether rects are cleared on stopping. Is start/stop/dump OK? Or does it have to be start/dump/stop? Some comments should be added to clarify.
Comment 11 Build Bot 2012-10-30 11:20:05 PDT
Comment on attachment 171484 [details]
Patch

Attachment 171484 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14641568
Comment 12 vollick 2012-10-30 13:17:44 PDT
Created attachment 171510 [details]
Patch

(In reply to comment #10)
> (From update of attachment 171484 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=171484&action=review
> 
> You should remove redundant lines, and annotate the method to describe the changes you made.
Done.
> 
> > Source/WebCore/testing/Internals.cpp:1414
> > +    frameView->setTracksRepaints(true);
> > +    frameView->resetTrackedRepaints();
> 
> These two lines are all over the place. If this is the contract (that starting tracking clears existing), then the reset should be moved to the FrameView code.
I had done all this to allow start/stop/dump (I didn't want stop to clear the rects), but in retrospect, start/dump/stop makes more sense -- far less code would need to be modified.

So I've gone back to having FrameView::setTracksRepaints clear the list of repaint rects. This let me stop littering everyone's code with resetTrackedRepaints.
> 
> > Source/WebCore/testing/Internals.idl:204
> > +    void startTrackingRepaints(in Document document) raises (DOMException);
> > +    void stopTrackingRepaints(in Document document) raises (DOMException);
> 
> It's not clear whether starting clears previous rects, and whether rects are cleared on stopping. Is start/stop/dump OK? Or does it have to be start/dump/stop? Some comments should be added to clarify.
Done.
Comment 13 Build Bot 2012-10-30 13:52:43 PDT
Comment on attachment 171510 [details]
Patch

Attachment 171510 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/14632633
Comment 14 vollick 2012-10-30 14:04:12 PDT
Created attachment 171515 [details]
Patch

Fixes a copy/paste error in WebKit2*.def
Comment 15 Raphael Kubo da Costa (:rakuco) 2012-10-31 02:38:53 PDT
*** Bug 99480 has been marked as a duplicate of this bug. ***
Comment 16 WebKit Review Bot 2012-10-31 03:26:41 PDT
Comment on attachment 171515 [details]
Patch

Rejecting attachment 171515 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:
st/repaint/layer-full-repaint-expected.txt'
rm 'LayoutTests/platform/qt/fast/repaint/layer-full-repaint-expected.png'
patching file LayoutTests/platform/qt/fast/repaint/layer-full-repaint-expected.txt
rm 'LayoutTests/platform/qt/fast/repaint/layer-full-repaint-expected.txt'
patching file ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Simon Fras..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue

Full output: http://queues.webkit.org/results/14678101
Comment 17 vollick 2012-10-31 05:46:22 PDT
Created attachment 171626 [details]
Patch

Rebasing. Hopefully it'll make it through the queue this time.
Comment 18 WebKit Review Bot 2012-10-31 08:37:12 PDT
Comment on attachment 171626 [details]
Patch

Clearing flags on attachment: 171626

Committed r133033: <http://trac.webkit.org/changeset/133033>
Comment 19 WebKit Review Bot 2012-10-31 08:37:18 PDT
All reviewed patches have been landed.  Closing bug.