Add basic pixel testing support to WebKitTestRunner
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Feb 2011 21:37:49 +0000 (21:37 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Feb 2011 21:37:49 +0000 (21:37 +0000)
commit99bfdf7bb2d663f4e1186db7c5ef601c4350953f
tree4b9aa831beb1e06764645ab61bc8902126afbb90
parent099958bd23554236c3a2cd858adb6e36701a566d
Add basic pixel testing support to WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=55161

Reviewed by Darin Adler.

* Scripts/old-run-webkit-tests:
Don't print color space information when using WebKitTestRunner since
we don't need to change the screen.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::initialize):
Add call to initializePlatformDefaults.

(WTR::InjectedBundle::done):
Return a dictionary on completion with both the text output and pixel dump override.

* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
Add declaration for initializePlatformDefaults.

* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::LayoutTestController):
(WTR::LayoutTestController::dumpAsText):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
(WTR::LayoutTestController::shouldDumpPixels):
Make setting dumpAsText override the dump pixels preference.

* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm: Added.
(WTR::InjectedBundle::initializePlatformDefaults):
Set platform defaults matching DumpRenderTree.

* WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp: Added.
(WTR::InjectedBundle::initializePlatformDefaults):
* WebKitTestRunner/InjectedBundle/win/InjectedBundleWin.cpp: Added.
(WTR::InjectedBundle::initializePlatformDefaults):
Add stubs for initializePlatformDefaults.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::runTest):
(WTR::TestController::runTestingServerLoop):
(WTR::TestController::run):
Parse expected pixel results out of stdin and setup the invocation with it.

* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::TestInvocation):
Initialize new members.

(WTR::TestInvocation::~TestInvocation):
(WTR::TestInvocation::setIsPixelTest):
(WTR::sizeWebViewForCurrentTest):
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::dump):
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestInvocation.h:
Dump pixels in addition to text by calling dumpPixelsAndCompareWithExpected.

* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView):
Use -[NSColorSpace genericRGBColorSpace] instead of the main screen color space.

* WebKitTestRunner/mac/TestInvocationMac.mm: Added.
(WTR::createCGContextFromPlatformView):
(WTR::computeMD5HashStringForContext):
(WTR::dumpBitmap):
(WTR::forceRepaintFunction):
(WTR::TestInvocation::dumpPixelsAndCompareWithExpected):
Add mac specific pixel dumping support. Right now, we always pull pixels
from the window server.

* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro:
* WebKitTestRunner/qt/WebKitTestRunner.pro:
* WebKitTestRunner/win/InjectedBundle.vcproj:
* WebKitTestRunner/win/WebKitTestRunner.vcproj:
Add new files.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Tools/ChangeLog
Tools/Scripts/old-run-webkit-tests
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro
Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/win/InjectedBundleWin.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/TestInvocation.h
Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
Tools/WebKitTestRunner/mac/TestInvocationMac.mm [new file with mode: 0644]
Tools/WebKitTestRunner/qt/TestInvocationQt.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/qt/WebKitTestRunner.pro
Tools/WebKitTestRunner/win/InjectedBundle.vcproj
Tools/WebKitTestRunner/win/TestInvocationWin.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/win/WebKitTestRunner.vcproj