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)
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

index 113e8328cd92c57eeb45611935e1a62d538f063e..623a42872fdd0bed651b3e03793173911739dd29 100644 (file)
@@ -1,3 +1,80 @@
+2011-02-24  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Add basic pixel testing support to WebKitTestRunner
+        https://bugs.webkit.org/show_bug.cgi?id=55161
+
+        * 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.
+
 2011-02-24  Chang Shu  <cshu@webkit.org>
 
         Reviewed by Kenneth Rohde Christiansen.
index 792cb4afbe58b0c218b997e44bb48cc33274fc78..3e57706d314096084ad78289c01e312628150dca 100755 (executable)
@@ -471,10 +471,12 @@ print "Running tests from $testDirectory\n";
 if ($pixelTests) {
     print "Enabling pixel tests with a tolerance of $tolerance%\n";
     if (isDarwin()) {
-        print "WARNING: Temporarily changing the main display color profile:\n";
-        print "\tThe colors on your screen will change for the duration of the testing.\n";
-        print "\tThis allows the pixel tests to have consistent color values across all machines.\n";
-        
+        if (!$useWebKitTestRunner) {
+            print "WARNING: Temporarily changing the main display color profile:\n";
+            print "\tThe colors on your screen will change for the duration of the testing.\n";
+            print "\tThis allows the pixel tests to have consistent color values across all machines.\n";
+        }
+
         if (isPerianInstalled()) {
             print "WARNING: Perian's QuickTime component is installed and this may affect pixel test results!\n";
             print "\tYou should avoid generating new pixel results in this environment.\n";
index d042431306bdccc23e211f7b0ae883a879e23f97..b7bebd47f4b8ff8b34501209b1493b8e9c557b99 100644 (file)
@@ -86,6 +86,8 @@ void InjectedBundle::initialize(WKBundleRef bundle)
     };
     WKBundleSetClient(m_bundle, &client);
 
+    initializePlatformDefaults();
+
     activateFonts();
     WKBundleActivateMacFontAscentHack(m_bundle);
 }
@@ -173,7 +175,15 @@ void InjectedBundle::done()
     setTopLoadingFrame(0);
 
     WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithUTF8CString("Done"));
-    WKRetainPtr<WKStringRef> doneMessageBody(AdoptWK, WKStringCreateWithUTF8CString(m_outputStream.str().c_str()));
+    WKRetainPtr<WKMutableDictionaryRef> doneMessageBody(AdoptWK, WKMutableDictionaryCreate());
+
+    WKRetainPtr<WKStringRef> textOutputKey(AdoptWK, WKStringCreateWithUTF8CString("TextOutput"));
+    WKRetainPtr<WKStringRef> textOutput(AdoptWK, WKStringCreateWithUTF8CString(m_outputStream.str().c_str()));
+    WKDictionaryAddItem(doneMessageBody.get(), textOutputKey.get(), textOutput.get());
+    
+    WKRetainPtr<WKStringRef> textOnlyKey(AdoptWK, WKStringCreateWithUTF8CString("TextOnly"));
+    WKRetainPtr<WKBooleanRef> textOnly(AdoptWK, WKBooleanCreate(!m_layoutTestController->shouldDumpPixels()));
+    WKDictionaryAddItem(doneMessageBody.get(), textOnlyKey.get(), textOnly.get());
 
     WKBundlePostMessage(m_bundle, doneMessageName.get(), doneMessageBody.get());
 
index 741ade48d985f6f1388e534d857df418e9e9a430..9cfe60cf35686a3bfaecc9fa52d1cd961e1114e4 100644 (file)
@@ -82,6 +82,7 @@ private:
     void didInitializePageGroup(WKBundlePageGroupRef);
     void didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody);
 
+    void initializePlatformDefaults();
     void resetLocalSettings();
 
     void beginTesting();
index 4707ed8b58f99437192e92524649ccff4ca95cc3..96a0d4799521742673b465a676a982ea4d5cfc0e 100644 (file)
@@ -94,6 +94,7 @@ LayoutTestController::LayoutTestController()
     , m_dumpEditingCallbacks(false)
     , m_dumpStatusCallbacks(false)
     , m_dumpTitleChanges(false)
+    , m_dumpPixels(true)
     , m_waitToDump(false)
     , m_testRepaint(false)
     , m_testRepaintSweepHorizontally(false)
@@ -116,6 +117,12 @@ void LayoutTestController::display()
     // FIXME: actually implement, once we want pixel tests
 }
 
+void LayoutTestController::dumpAsText()
+{
+    m_whatToDump = MainFrameText;
+    m_dumpPixels = false;
+}
+    
 void LayoutTestController::waitUntilDone()
 {
     m_waitToDump = true;
index 92711241acbe17a40f1f0d3509d71bf0815c4624..67333803820166669a40e8675894f14855fbd836 100644 (file)
@@ -55,7 +55,7 @@ public:
     void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
 
     // The basics.
-    void dumpAsText() { m_whatToDump = MainFrameText; }
+    void dumpAsText();
     void dumpChildFramesAsText() { m_whatToDump = AllFramesText; }
     void waitUntilDone();
     void notifyDone();
@@ -114,6 +114,7 @@ public:
     bool shouldDumpMainFrameScrollPosition() const { return m_whatToDump == RenderTree; }
     bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
     bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; }
+    bool shouldDumpPixels() const { return m_dumpPixels; }
 
     bool waitToDump() const { return m_waitToDump; }
     void waitToDumpWatchdogTimerFired();
@@ -154,6 +155,7 @@ private:
     bool m_dumpEditingCallbacks;
     bool m_dumpStatusCallbacks;
     bool m_dumpTitleChanges;
+    bool m_dumpPixels;
     bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
     bool m_testRepaint;
     bool m_testRepaintSweepHorizontally;
diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm
new file mode 100644 (file)
index 0000000..e947a80
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "InjectedBundle.h"
+
+namespace WTR {
+
+void InjectedBundle::initializePlatformDefaults()
+{
+    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
+        [NSNumber numberWithInteger:4],   @"AppleAntiAliasingThreshold",
+        [NSNumber numberWithInteger:0],   @"AppleFontSmoothing",
+        [NSNumber numberWithBool:NO],     @"AppleScrollAnimationEnabled",
+        [NSNumber numberWithBool:NO],     @"NSOverlayScrollersEnabled",
+        @"Always",                        @"AppleShowScrollBars",
+        nil];
+
+    [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
+}
+
+} // namespace WTR
index dabe1cca86c8fd3f0a4180d5a456c64ac90a560e..6838205b4c13fe369e87ef69f8c3d5c2e12c7d99 100644 (file)
@@ -24,6 +24,7 @@ SOURCES += \
     ../LayoutTestController.h \
     ../Bindings/JSWrapper.cpp \
     ActivateFontsQt.cpp \
+    InjectedBundleQt.cpp \
     LayoutTestControllerQt.cpp \
     $$GENERATED_SOURCES_DIR/JSEventSendingController.cpp \
     $$GENERATED_SOURCES_DIR/JSGCController.cpp \
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp
new file mode 100644 (file)
index 0000000..aa0b8ef
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "InjectedBundle.h"
+
+namespace WTR {
+
+void InjectedBundle::initializePlatformDefaults()
+{
+}
+
+} // namespace WTR
diff --git a/Tools/WebKitTestRunner/InjectedBundle/win/InjectedBundleWin.cpp b/Tools/WebKitTestRunner/InjectedBundle/win/InjectedBundleWin.cpp
new file mode 100644 (file)
index 0000000..aa0b8ef
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "InjectedBundle.h"
+
+namespace WTR {
+
+void InjectedBundle::initializePlatformDefaults()
+{
+}
+
+} // namespace WTR
index 413ae30cb3d9ede38d75d2da98b468fc7e3ec115..194214b15f6248db80df0f2d2c8d8037c58aae24 100644 (file)
@@ -384,8 +384,20 @@ bool TestController::runTest(const char* test)
         return false;
     }
 
+    std::string pathOrURL(test);
+    std::string expectedPixelHash;
+    size_t separatorPos = pathOrURL.find("'");
+    if (separatorPos != std::string::npos) {
+        pathOrURL = std::string(std::string(test), 0, separatorPos);
+        expectedPixelHash = std::string(std::string(test), separatorPos + 1);
+    }
+
     m_state = RunningTest;
-    m_currentInvocation.set(new TestInvocation(test));
+
+    m_currentInvocation.set(new TestInvocation(pathOrURL));
+    if (m_dumpPixels)
+        m_currentInvocation->setIsPixelTest(expectedPixelHash);    
+
     m_currentInvocation->invoke();
     m_currentInvocation.clear();
 
@@ -396,7 +408,7 @@ void TestController::runTestingServerLoop()
 {
     char filenameBuffer[2048];
     while (fgets(filenameBuffer, sizeof(filenameBuffer), stdin)) {
-        char *newLineCharacter = strchr(filenameBuffer, '\n');
+        charnewLineCharacter = strchr(filenameBuffer, '\n');
         if (newLineCharacter)
             *newLineCharacter = '\0';
 
@@ -418,7 +430,6 @@ void TestController::run()
                 break;
         }
     }
-
 }
 
 void TestController::runUntil(bool& done, TimeoutDuration timeoutDuration)
index 3af184ad4a5deb1858ef0d8d4e2481287ff3a63a..7d0ffcd0916b27f01cd91f38738b32b4909e06b0 100644 (file)
@@ -85,18 +85,25 @@ static WKURLRef createWKURL(const char* pathOrURL)
     return WKURLCreateWithUTF8CString(buffer.get());
 }
 
-TestInvocation::TestInvocation(const char* pathOrURL)
-    : m_url(AdoptWK, createWKURL(pathOrURL))
-    , m_pathOrURL(fastStrDup(pathOrURL))
+TestInvocation::TestInvocation(const std::string& pathOrURL)
+    : m_url(AdoptWK, createWKURL(pathOrURL.c_str()))
+    , m_pathOrURL(pathOrURL)
+    , m_dumpPixels(false)
     , m_gotInitialResponse(false)
     , m_gotFinalMessage(false)
+    , m_gotRepaint(false)
     , m_error(false)
 {
 }
 
 TestInvocation::~TestInvocation()
 {
-    fastFree(m_pathOrURL);
+}
+
+void TestInvocation::setIsPixelTest(const std::string& expectedPixelHash)
+{
+    m_dumpPixels = true;
+    m_expectedPixelHash = expectedPixelHash;
 }
 
 static const unsigned w3cSVGWidth = 480;
@@ -104,7 +111,7 @@ static const unsigned w3cSVGHeight = 360;
 static const unsigned normalWidth = 800;
 static const unsigned normalHeight = 600;
 
-static void sizeWebViewForCurrentTest(char* pathOrURL)
+static void sizeWebViewForCurrentTest(const char* pathOrURL)
 {
     bool isSVGW3CTest = strstr(pathOrURL, "svg/W3C-SVG-1.1") || strstr(pathOrURL, "svg\\W3C-SVG-1.1");
 
@@ -121,7 +128,7 @@ static bool shouldOpenWebInspector(const char* pathOrURL)
 
 void TestInvocation::invoke()
 {
-    sizeWebViewForCurrentTest(m_pathOrURL);
+    sizeWebViewForCurrentTest(m_pathOrURL.c_str());
 
     WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("BeginTest"));
     WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), 0);
@@ -136,7 +143,7 @@ void TestInvocation::invoke()
         return;
     }
 
-    if (shouldOpenWebInspector(m_pathOrURL))
+    if (shouldOpenWebInspector(m_pathOrURL.c_str()))
         WKInspectorShow(WKPageGetInspector(TestController::shared().mainWebView()->page()));
 
     WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get());
@@ -155,12 +162,8 @@ void TestInvocation::dump(const char* stringToDump)
     printf("Content-Type: text/plain\n");
     printf("%s", stringToDump);
 
-    fputs("#EOF\n", stdout);
     fputs("#EOF\n", stdout);
     fputs("#EOF\n", stderr);
-
-    fflush(stdout);
-    fflush(stderr);
 }
 
 void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
@@ -187,11 +190,26 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
     }
 
     if (WKStringIsEqualToUTF8CString(messageName, "Done")) {
-        ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
-        WKStringRef messageBodyString = static_cast<WKStringRef>(messageBody);
+        ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+        WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
+
+        WKRetainPtr<WKStringRef> textOutputKey(AdoptWK, WKStringCreateWithUTF8CString("TextOutput"));
+        WKStringRef textOutput = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, textOutputKey.get()));
+
+        WKRetainPtr<WKStringRef> textOnlyKey(AdoptWK, WKStringCreateWithUTF8CString("TextOnly"));
+        bool textOnly = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, textOnlyKey.get())));
+
+        // Dump text.
+        dump(toSTD(textOutput).c_str());
 
-        dump(toSTD(messageBodyString).c_str());
+        // Dump pixels (if necessary).
+        if (m_dumpPixels && !textOnly)
+            dumpPixelsAndCompareWithExpected();
 
+        fputs("#EOF\n", stdout);
+        fflush(stdout);
+        fflush(stderr);
+        
         m_gotFinalMessage = true;
         TestController::shared().notifyDone();
         return;
index efc6635cbfb045299b2bec2484dddb24224b026b..d5a4af9068084e0af452e653d36b12312923d044 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef TestInvocation_h
 #define TestInvocation_h
 
+#include <string>
 #include <WebKit2/WKRetainPtr.h>
 #include <wtf/Noncopyable.h>
 
@@ -34,22 +35,29 @@ namespace WTR {
 class TestInvocation {
     WTF_MAKE_NONCOPYABLE(TestInvocation);
 public:
-    TestInvocation(const char*);
+    TestInvocation(const std::string& pathOrURL);
     ~TestInvocation();
 
+    void setIsPixelTest(const std::string& expectedPixelHash);
+    
     void invoke();
     void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
     WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
 
 private:
     void dump(const char*);
-
+    void dumpPixelsAndCompareWithExpected();
+    
     WKRetainPtr<WKURLRef> m_url;
-    char* m_pathOrURL;
+    std::string m_pathOrURL;
+    
+    bool m_dumpPixels;
+    std::string m_expectedPixelHash;
 
     // Invocation state
     bool m_gotInitialResponse;
     bool m_gotFinalMessage;
+    bool m_gotRepaint;
     bool m_error;
 };
 
index 8428403136bd1145e6483af8ca354df448966bd1..62105cd25603d72c7f6dd2c4c1571b4c1cfb68be 100644 (file)
@@ -47,6 +47,8 @@
                BC7934AC1190658C005EA8E2 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934AB1190658C005EA8E2 /* WebKit2.framework */; };
                BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */; };
                BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8C795B11D2785D004535A1 /* TestControllerMac.mm */; };
+               BC8DAD5D1315C0EC00EC96FC /* TestInvocationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8DAD5B1315C0EC00EC96FC /* TestInvocationMac.mm */; };
+               BC8DAD7B1316D91000EC96FC /* InjectedBundleMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8DAD771316D7B900EC96FC /* InjectedBundleMac.mm */; };
                BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8C9120E527F00F3E71A /* EventSendingController.cpp */; };
                BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */; };
                BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952C0C11F3B965003398B4 /* JSWrapper.cpp */; };
                BC7934DD119066EC005EA8E2 /* PlatformWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformWebView.h; sourceTree = "<group>"; };
                BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformWebViewMac.mm; sourceTree = "<group>"; };
                BC8C795B11D2785D004535A1 /* TestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestControllerMac.mm; sourceTree = "<group>"; };
+               BC8DAD5B1315C0EC00EC96FC /* TestInvocationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestInvocationMac.mm; sourceTree = "<group>"; };
+               BC8DAD771316D7B900EC96FC /* InjectedBundleMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InjectedBundleMac.mm; sourceTree = "<group>"; };
                BC8FD8C8120E527F00F3E71A /* EventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSendingController.h; sourceTree = "<group>"; };
                BC8FD8C9120E527F00F3E71A /* EventSendingController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventSendingController.cpp; sourceTree = "<group>"; };
                BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventSendingController.idl; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                65EB859F11EC67CC0034D300 /* ActivateFonts.mm */,
+                               BC8DAD771316D7B900EC96FC /* InjectedBundleMac.mm */,
                        );
                        path = mac;
                        sourceTree = "<group>";
                                BC7933FF118F7C84005EA8E2 /* main.mm */,
                                BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */,
                                BC8C795B11D2785D004535A1 /* TestControllerMac.mm */,
+                               BC8DAD5B1315C0EC00EC96FC /* TestInvocationMac.mm */,
                        );
                        path = mac;
                        sourceTree = "<group>";
                                BC793431118F7F19005EA8E2 /* TestController.cpp in Sources */,
                                BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */,
                                BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */,
+                               BC8DAD5D1315C0EC00EC96FC /* TestInvocationMac.mm in Sources */,
                                BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                                BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */,
                                BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */,
                                BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */,
+                               BC8DAD7B1316D91000EC96FC /* InjectedBundleMac.mm in Sources */,
                                BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */,
                                BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */,
                                C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */,
index b68f6a30319abf4d4ee7ba5bb58f1ff8d1254bda..8415692736c7fc3199cc5a407cc86b5ad78e37b8 100644 (file)
@@ -34,7 +34,7 @@ PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGro
 
     NSRect windowRect = NSOffsetRect(rect, -10000, [[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000);
     m_window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
-    [m_window setColorSpace:[[NSScreen mainScreen] colorSpace]];
+    [m_window setColorSpace:[NSColorSpace genericRGBColorSpace]];
     [[m_window contentView] addSubview:m_view];
     [m_window orderBack:nil];
     [m_window setAutodisplay:NO];
diff --git a/Tools/WebKitTestRunner/mac/TestInvocationMac.mm b/Tools/WebKitTestRunner/mac/TestInvocationMac.mm
new file mode 100644 (file)
index 0000000..13a0295
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TestInvocation.h"
+
+#include "PlatformWebView.h"
+#include "TestController.h"
+#include <ImageIO/CGImageDestination.h>
+#include <LaunchServices/UTCoreTypes.h>
+#include <WebKit2/WKPage.h>
+#include <wtf/RetainPtr.h>
+
+#define COMMON_DIGEST_FOR_OPENSSL
+#include <CommonCrypto/CommonDigest.h>
+
+namespace WTR {
+
+static CGContextRef createCGContextFromPlatformView(PlatformWebView* platformWebView)
+{
+    WKView* view = platformWebView->platformView();
+    [view display];
+
+    NSSize webViewSize = [view frame].size;
+    size_t pixelsWide = static_cast<size_t>(webViewSize.width);
+    size_t pixelsHigh = static_cast<size_t>(webViewSize.height);
+    size_t rowBytes = (4 * pixelsWide + 63) & ~63;
+    void* buffer = calloc(pixelsHigh, rowBytes);
+
+    CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
+    CGContextRef context = CGBitmapContextCreate(buffer, pixelsWide, pixelsHigh, 8, rowBytes, colorSpace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host);
+    CGColorSpaceRelease(colorSpace);
+    
+    CGImageRef image = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, [[view window] windowNumber], kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque);
+    CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)), image);
+    CGImageRelease(image);
+
+    return context;
+}
+
+void computeMD5HashStringForContext(CGContextRef bitmapContext, char hashString[33])
+{
+    ASSERT(CGBitmapContextGetBitsPerPixel(bitmapContext) == 32); // ImageDiff assumes 32 bit RGBA, we must as well.
+    size_t pixelsHigh = CGBitmapContextGetHeight(bitmapContext);
+    size_t pixelsWide = CGBitmapContextGetWidth(bitmapContext);
+    size_t bytesPerRow = CGBitmapContextGetBytesPerRow(bitmapContext);
+    
+    // We need to swap the bytes to ensure consistent hashes independently of endianness
+    MD5_CTX md5Context;
+    MD5_Init(&md5Context);
+    unsigned char* bitmapData = static_cast<unsigned char*>(CGBitmapContextGetData(bitmapContext));
+    if ((CGBitmapContextGetBitmapInfo(bitmapContext) & kCGBitmapByteOrderMask) == kCGBitmapByteOrder32Big) {
+        for (unsigned row = 0; row < pixelsHigh; row++) {
+            uint32_t buffer[pixelsWide];
+            for (unsigned column = 0; column < pixelsWide; column++)
+                buffer[column] = OSReadLittleInt32(bitmapData, 4 * column);
+            MD5_Update(&md5Context, buffer, 4 * pixelsWide);
+            bitmapData += bytesPerRow;
+        }
+    } else {
+        for (unsigned row = 0; row < pixelsHigh; row++) {
+            MD5_Update(&md5Context, bitmapData, 4 * pixelsWide);
+            bitmapData += bytesPerRow;
+        }
+    }
+
+    unsigned char hash[16];
+    MD5_Final(hash, &md5Context);
+    
+    hashString[0] = '\0';
+    for (int i = 0; i < 16; i++)
+        snprintf(hashString, 33, "%s%02x", hashString, hash[i]);
+}
+
+static void dumpBitmap(CGContextRef bitmapContext)
+{
+    RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(bitmapContext));
+    RetainPtr<CFMutableDataRef> imageData(AdoptCF, CFDataCreateMutable(0, 0));
+    RetainPtr<CGImageDestinationRef> imageDest(AdoptCF, CGImageDestinationCreateWithData(imageData.get(), kUTTypePNG, 1, 0));
+    CGImageDestinationAddImage(imageDest.get(), image.get(), 0);
+    CGImageDestinationFinalize(imageDest.get());
+
+    const unsigned char* data = CFDataGetBytePtr(imageData.get());
+    const size_t dataLength = CFDataGetLength(imageData.get());
+
+
+    fprintf(stdout, "Content-Type: %s\n", "image/png");
+    fprintf(stdout, "Content-Length: %lu\n", static_cast<unsigned long>(dataLength));
+    
+    const size_t bytesToWriteInOneChunk = 1 << 15;
+    size_t dataRemainingToWrite = dataLength;
+    while (dataRemainingToWrite) {
+        size_t bytesToWriteInThisChunk = std::min(dataRemainingToWrite, bytesToWriteInOneChunk);
+        size_t bytesWritten = fwrite(data, 1, bytesToWriteInThisChunk, stdout);
+        if (bytesWritten != bytesToWriteInThisChunk)
+            break;
+        dataRemainingToWrite -= bytesWritten;
+        data += bytesWritten;
+    }
+}
+
+static void forceRepaintFunction(WKErrorRef, void* context)
+{
+    *static_cast<bool*>(context) = true;
+}
+
+void TestInvocation::dumpPixelsAndCompareWithExpected()
+{
+    WKPageForceRepaint(TestController::shared().mainWebView()->page(), &m_gotRepaint, forceRepaintFunction);
+    TestController::shared().runUntil(m_gotRepaint, TestController::LongTimeout);
+    
+    CGContextRef context = createCGContextFromPlatformView(TestController::shared().mainWebView());
+    
+    // Compute the hash of the bitmap context pixels
+    char actualHash[33];
+    computeMD5HashStringForContext(context, actualHash);
+    fprintf(stdout, "\nActualHash: %s\n", actualHash);
+
+    // Check the computed hash against the expected one and dump image on mismatch
+    bool hashesMatch = false;
+    if (m_expectedPixelHash.length() > 0) {
+        ASSERT(m_expectedPixelHash.length() == 32);
+
+        fprintf(stdout, "\nExpectedHash: %s\n", m_expectedPixelHash.c_str());
+
+        // FIXME: Do case insensitive compare.
+        if (m_expectedPixelHash == actualHash)
+            hashesMatch = true;
+    }
+
+    if (!hashesMatch)
+        dumpBitmap(context);
+}
+
+} // namespace WTR
diff --git a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp
new file mode 100644 (file)
index 0000000..b5fbda4
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TestInvocation.h"
+
+namespace WTR {
+
+void TestInvocation::dumpPixelsAndCompareWithExpected()
+{
+}
+
+} // namespace WTR
index 48abc45900bff848ea9faca74ea4835af08f9f11..1172eea75e6d8e2f1e45c911bd07d4d0e84c7194 100644 (file)
@@ -48,6 +48,7 @@ SOURCES = \
     main.cpp \
     PlatformWebViewQt.cpp \
     TestControllerQt.cpp \
+    TestInvocationQt.cpp \
     $$BASEDIR/TestController.cpp \
     $$BASEDIR/TestInvocation.cpp \
 
index f615d50d1fc006628b9644a937198f9208f52f59..eec770b28d760997e9106fb49a1d77b7c2f8903f 100644 (file)
                        RelativePath="..\InjectedBundle\win\ActivateFonts.cpp"
                        >
                </File>
+               <File
+                       RelativePath="..\InjectedBundle\win\InjectedBundleWin.cpp"
+                       >
+               </File>
                <File
                        RelativePath="..\InjectedBundle\EventSendingController.cpp"
                        >
diff --git a/Tools/WebKitTestRunner/win/TestInvocationWin.cpp b/Tools/WebKitTestRunner/win/TestInvocationWin.cpp
new file mode 100644 (file)
index 0000000..b5fbda4
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TestInvocation.h"
+
+namespace WTR {
+
+void TestInvocation::dumpPixelsAndCompareWithExpected()
+{
+}
+
+} // namespace WTR
index 09dea95c039044f48342722db2dcc5c008e7ac08..e12338a536d43053741494004503ccbfa027f9a6 100644 (file)
                                RelativePath=".\TestControllerWin.cpp"
                                >
                        </File>
+                       <File
+                               RelativePath=".\TestInvocationWin.cpp"
+                               >
+                       </File>
                </Filter>
                <File
                        RelativePath="..\PlatformWebView.h"