Repaint tests don't work in WebKit2
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Sep 2011 22:19:10 +0000 (22:19 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Sep 2011 22:19:10 +0000 (22:19 +0000)
commitf597945da1fc8d68e433abb07a97ead61862ee4e
tree7ae0b81634d3d1980e1af7040947e3f07f5163fc
parent13c10c720886a0f414c5d4e531936b636f1106ee
Repaint tests don't work in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=68453

Tools:

Reviewed by Sam Weinig.

Convert DumpRenderTree to use use the repaint rects
exposed via WebKit API when generating the repaint test
overlay.

Fix WebKitTestRunner to work with repaint tests, again
using the repaint rects exposed from WK2.

In both cases, layoutTestController.display() now just
forces a display of the web view, and turns on repaint
rect tracking on the main FrameView.

Later, when pixel results are requested, the alpha overlay
that shows the repaint rects is generated using the list
of rects supplied by WebCore.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetDefaultsToConsistentValues):
(resetWebViewToConsistentStateBeforeTesting):
(displayWebView):
* DumpRenderTree/mac/PixelDumpSupportMac.mm:
(paintRepaintRectOverlay):
(createBitmapContextFromWebView):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
(WTR::InjectedBundle::done):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::setRepaintRects):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::reset):
(WTR::InjectedBundlePage::dump):
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::display):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cg/TestInvocationCG.cpp:
(WTR::paintRepaintRectOverlay):
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected):

LayoutTests:

Reviewed by Sam Weinig.

Update Mac results to use the new repaint rects. Differences from old results:
        * There are no longer invalidates from scrolling.
        * We no longer see the effects of AppKit rect coalescing.
        * Composting tests show the overlay now, but repaints in compositing layers do not show.

    Bad results in a couple of tests are covered by bugs 68830 and 68829.

* platform/mac/fast/repaint/4774354-expected.png:
* platform/mac/fast/repaint/block-layout-inline-children-float-positioned-expected.png:
* platform/mac/fast/repaint/block-selection-gap-in-composited-layer-expected.png:
* platform/mac/fast/repaint/border-radius-repaint-expected.png:
* platform/mac/fast/repaint/clipped-relative-expected.png:
* platform/mac/fast/repaint/containing-block-position-change-expected.png:
* platform/mac/fast/repaint/control-clip-expected.png:
* platform/mac/fast/repaint/delete-into-nested-block-expected.png:
* platform/mac/fast/repaint/fixed-and-absolute-position-scrolled-expected.png:
* platform/mac/fast/repaint/fixed-scroll-simple-expected.png:
* platform/mac/fast/repaint/flexible-box-overflow-expected.png:
* platform/mac/fast/repaint/flexible-box-overflow-horizontal-expected.png:
* platform/mac/fast/repaint/float-move-during-layout-expected.png:
* platform/mac/fast/repaint/float-overflow-expected.png:
* platform/mac/fast/repaint/float-overflow-right-expected.png:
* platform/mac/fast/repaint/iframe-scroll-repaint-expected.png:
* platform/mac/fast/repaint/inline-block-overflow-expected.png:
* platform/mac/fast/repaint/japanese-rl-selection-repaint-expected.png:
* platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png:
* platform/mac/fast/repaint/layer-child-outline-expected.png:
* platform/mac/fast/repaint/layer-outline-expected.png:
* platform/mac/fast/repaint/layer-outline-horizontal-expected.png:
* platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.png:
* platform/mac/fast/repaint/line-overflow-expected.png:
* platform/mac/fast/repaint/nested-iframe-scroll-inner-expected.png:
* platform/mac/fast/repaint/nested-iframe-scroll-outer-expected.png:
* platform/mac/fast/repaint/outline-child-repaint-expected.png:
* platform/mac/fast/repaint/outline-shrinking-expected.png:
* platform/mac/fast/repaint/overflow-delete-line-expected.png:
* platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.png:
* platform/mac/fast/repaint/repaint-during-scroll-expected.png:
* platform/mac/fast/repaint/scale-page-shrink-expected.png:
* platform/mac/fast/repaint/search-field-cancel-expected.png:
* platform/mac/fast/repaint/selection-after-remove-expected.png:
* platform/mac/fast/repaint/shadow-multiple-horizontal-expected.png:
* platform/mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png:
* platform/mac/fast/repaint/shadow-multiple-strict-vertical-expected.png:
* platform/mac/fast/repaint/shadow-multiple-vertical-expected.png:
* platform/mac/fast/repaint/static-to-positioned-expected.png:
* platform/mac/fast/repaint/table-cell-move-expected.png:
* platform/mac/fast/repaint/text-selection-rect-in-overflow-2-expected.png:
* platform/mac/fast/repaint/text-shadow-expected.png:
* platform/mac/fast/repaint/text-shadow-horizontal-expected.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
54 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/fast/repaint/4774354-expected.png
LayoutTests/platform/mac/fast/repaint/block-layout-inline-children-float-positioned-expected.png
LayoutTests/platform/mac/fast/repaint/block-selection-gap-in-composited-layer-expected.png
LayoutTests/platform/mac/fast/repaint/border-radius-repaint-expected.png
LayoutTests/platform/mac/fast/repaint/clipped-relative-expected.png
LayoutTests/platform/mac/fast/repaint/containing-block-position-change-expected.png
LayoutTests/platform/mac/fast/repaint/control-clip-expected.png
LayoutTests/platform/mac/fast/repaint/delete-into-nested-block-expected.png
LayoutTests/platform/mac/fast/repaint/fixed-and-absolute-position-scrolled-expected.png
LayoutTests/platform/mac/fast/repaint/fixed-scroll-simple-expected.png
LayoutTests/platform/mac/fast/repaint/flexible-box-overflow-expected.png
LayoutTests/platform/mac/fast/repaint/flexible-box-overflow-horizontal-expected.png
LayoutTests/platform/mac/fast/repaint/float-move-during-layout-expected.png
LayoutTests/platform/mac/fast/repaint/float-overflow-expected.png
LayoutTests/platform/mac/fast/repaint/float-overflow-right-expected.png
LayoutTests/platform/mac/fast/repaint/iframe-scroll-repaint-expected.png
LayoutTests/platform/mac/fast/repaint/inline-block-overflow-expected.png
LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-expected.png
LayoutTests/platform/mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png
LayoutTests/platform/mac/fast/repaint/layer-child-outline-expected.png
LayoutTests/platform/mac/fast/repaint/layer-outline-expected.png
LayoutTests/platform/mac/fast/repaint/layer-outline-horizontal-expected.png
LayoutTests/platform/mac/fast/repaint/line-flow-with-floats-in-regions-expected.png
LayoutTests/platform/mac/fast/repaint/line-overflow-expected.png
LayoutTests/platform/mac/fast/repaint/nested-iframe-scroll-inner-expected.png
LayoutTests/platform/mac/fast/repaint/nested-iframe-scroll-outer-expected.png
LayoutTests/platform/mac/fast/repaint/outline-child-repaint-expected.png
LayoutTests/platform/mac/fast/repaint/outline-shrinking-expected.png
LayoutTests/platform/mac/fast/repaint/overflow-delete-line-expected.png
LayoutTests/platform/mac/fast/repaint/overflow-flipped-writing-mode-block-in-regions-expected.png
LayoutTests/platform/mac/fast/repaint/repaint-during-scroll-expected.png
LayoutTests/platform/mac/fast/repaint/scale-page-shrink-expected.png
LayoutTests/platform/mac/fast/repaint/search-field-cancel-expected.png
LayoutTests/platform/mac/fast/repaint/selection-after-remove-expected.png
LayoutTests/platform/mac/fast/repaint/shadow-multiple-horizontal-expected.png
LayoutTests/platform/mac/fast/repaint/shadow-multiple-strict-horizontal-expected.png
LayoutTests/platform/mac/fast/repaint/shadow-multiple-strict-vertical-expected.png
LayoutTests/platform/mac/fast/repaint/shadow-multiple-vertical-expected.png
LayoutTests/platform/mac/fast/repaint/static-to-positioned-expected.png
LayoutTests/platform/mac/fast/repaint/table-cell-move-expected.png
LayoutTests/platform/mac/fast/repaint/text-selection-rect-in-overflow-2-expected.png
LayoutTests/platform/mac/fast/repaint/text-shadow-expected.png
LayoutTests/platform/mac/fast/repaint/text-shadow-horizontal-expected.png
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/TestInvocation.h
Tools/WebKitTestRunner/cg/TestInvocationCG.cpp