[Qt][WTR] Do a forced repaint before generating pixel results
authorkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2012 08:44:24 +0000 (08:44 +0000)
committerkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Oct 2012 08:44:24 +0000 (08:44 +0000)
commit3b277a736eedea65db295763e174d902f82dc505
treedd40dda60c9ee183d88194d1ea6554a2e77182da
parentb45465ddb47257b438b4fd177bba9c130f1d7b36
[Qt][WTR] Do a forced repaint before generating pixel results
https://bugs.webkit.org/show_bug.cgi?id=98654

Reviewed by Jocelyn Turcotte.

Source/WebKit2:

Added API to convert a QImage to a WKImage so we can
pass it to cross-platform code.

* Shared/API/c/qt/WKImageQt.cpp:
(WKImageCreateFromQImage):
* Shared/API/c/qt/WKImageQt.h:

Tools:

Do a forced repaint before grabbing the pixel snapshot. This extra
synchronisation is necessary with the CoordinatedGraphics rendering
backend because it has a fully asynchronous nature. This patch make
us using the window snapshot for pixel results which is necessary to
capture animations and other dynamic content. The actual grabbing of
the window has not been implemented in this patch. It will come in
a follow-up.

* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::dump): Store results in member variables.
Don't close output channels yet.
(WTR::TestInvocation::dumpResults): Added. This is where we dump
the results if no error happened.
(WTR):
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestInvocation.h:
(TestInvocation):
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::windowSnapshotImage):
* WebKitTestRunner/qt/TestInvocationQt.cpp:
(WTR::TestInvocation::forceRepaintDoneCallback):
(WTR):
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/qt/WKImageQt.cpp
Source/WebKit2/Shared/API/c/qt/WKImageQt.h
Tools/ChangeLog
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/TestInvocation.h
Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
Tools/WebKitTestRunner/qt/TestInvocationQt.cpp