Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From b9da14bc5a24f7c4ea7e86d02cba60e6af6211aa Mon Sep 17 00:00:00 2001
- From: Balazs Kelemen <kbalazs@webkit.org>
- Date: Fri, 1 Oct 2010 14:36:03 +0200
- Subject: [PATCH] [Qt] Setting up WebKitTestRunner build
- ---
- DerivedSources.pro | 1 +
- WebKit.pro | 1 +
- WebKit2/DerivedSources.pro | 2 +-
- WebKit2/UIProcess/API/C/WebKit2.h | 2 +-
- WebKit2/WebKit2.pro | 2 +
- WebKit2/generate-forwarding-headers.pl | 4 +-
- WebKitTools/Scripts/webkitdirs.pm | 1 +
- WebKitTools/WebKitTestRunner/PlatformWebView.h | 5 +-
- WebKitTools/WebKitTestRunner/qt/DerivedSources.pro | 18 +++++
- .../WebKitTestRunner/qt/PlatformWebViewQt.cpp | 70 ++++++++++++++++++++
- .../WebKitTestRunner/qt/TestControllerQt.cpp | 61 +++++++++++++++++
- .../WebKitTestRunner/qt/WebKitTestRunner.pro | 67 +++++++++++++++++++
- WebKitTools/WebKitTestRunner/qt/main.cpp | 34 ++++++++++
- 13 files changed, 264 insertions(+), 4 deletions(-)
- create mode 100644 WebKitTools/WebKitTestRunner/qt/DerivedSources.pro
- create mode 100644 WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
- create mode 100644 WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
- create mode 100644 WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro
- create mode 100644 WebKitTools/WebKitTestRunner/qt/main.cpp
- diff --git a/DerivedSources.pro b/DerivedSources.pro
- index 880a716..0015af6 100644
- --- a/DerivedSources.pro
- +++ b/DerivedSources.pro
- @@ -8,6 +8,7 @@ SUBDIRS += \
- webkit2 {
- SUBDIRS += WebKit2/DerivedSources.pro
- + SUBDIRS += WebKitTools/WebKitTestRunner/qt/DerivedSources.pro
- }
- for(subpro, SUBDIRS) {
- diff --git a/WebKit.pro b/WebKit.pro
- index 9fd9c2e..898a4ec 100644
- --- a/WebKit.pro
- +++ b/WebKit.pro
- @@ -33,6 +33,7 @@ build-qtscript {
- webkit2 {
- exists($$PWD/WebKit2/WebProcess.pro): SUBDIRS += WebKit2/WebProcess.pro
- exists($$PWD/WebKitTools/MiniBrowser/qt/MiniBrowser.pro): SUBDIRS += WebKitTools/MiniBrowser/qt/MiniBrowser.pro
- + exists($$PWD/WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro): SUBDIRS += WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro
- }
- symbian {
- diff --git a/WebKit2/DerivedSources.pro b/WebKit2/DerivedSources.pro
- index 3560878..90ebfac 100644
- --- a/WebKit2/DerivedSources.pro
- +++ b/WebKit2/DerivedSources.pro
- @@ -52,7 +52,7 @@ messagereceiver_generator.target = $${OUTPUT_DIR}/WebKit2/generated/WebPageMes
- generated_files.depends += messagereceiver_generator
- QMAKE_EXTRA_TARGETS += messagereceiver_generator
- -fwheader_generator.commands = perl $${SRC_ROOT_DIR}/WebKit2/generate-forwarding-headers.pl $${OUTPUT_DIR}/include qt
- +fwheader_generator.commands = perl $${SRC_ROOT_DIR}/WebKit2/generate-forwarding-headers.pl $${SRC_ROOT_DIR}/WebKit2 $${OUTPUT_DIR}/include qt
- fwheader_generator.depends = $${SRC_ROOT_DIR}/WebKit2/generate-forwarding-headers.pl
- generated_files.depends += fwheader_generator
- QMAKE_EXTRA_TARGETS += fwheader_generator
- diff --git a/WebKit2/UIProcess/API/C/WebKit2.h b/WebKit2/UIProcess/API/C/WebKit2.h
- index 74e1f8c..88022d8 100644
- --- a/WebKit2/UIProcess/API/C/WebKit2.h
- +++ b/WebKit2/UIProcess/API/C/WebKit2.h
- @@ -50,7 +50,7 @@
- #include <WebKit2/WKURLRequest.h>
- #include <WebKit2/WKURLResponse.h>
- -#if !__APPLE__ || __OBJC__
- +#if (!defined(__APPLE__) || !__APPLE__) || (defined(__OBJC__) && __OBJC__)
- #include <WebKit2/WKView.h>
- #endif
- diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
- index 5f1731b..c9189a5 100644
- --- a/WebKit2/WebKit2.pro
- +++ b/WebKit2/WebKit2.pro
- @@ -209,6 +209,7 @@ HEADERS += \
- UIProcess/API/C/WKPageNamespace.h \
- UIProcess/API/C/WKPagePrivate.h \
- UIProcess/API/C/WKPreferences.h \
- + UIProcess/API/C/WKPreferencesPrivate.h \
- UIProcess/API/cpp/qt/WKStringQt.h \
- UIProcess/API/cpp/qt/WKURLQt.h \
- UIProcess/API/cpp/WKRetainPtr.h \
- @@ -333,6 +334,7 @@ SOURCES += \
- UIProcess/API/C/WKPage.cpp \
- UIProcess/API/C/WKPageNamespace.cpp \
- UIProcess/API/C/WKPreferences.cpp \
- + UIProcess/API/C/WKPreferencesPrivate.cpp \
- UIProcess/API/qt/ClientImpl.cpp \
- UIProcess/API/qt/qgraphicswkview.cpp \
- UIProcess/API/qt/qwkpage.cpp \
- diff --git a/WebKit2/generate-forwarding-headers.pl b/WebKit2/generate-forwarding-headers.pl
- index e836fa4..bb6a14f 100755
- --- a/WebKit2/generate-forwarding-headers.pl
- +++ b/WebKit2/generate-forwarding-headers.pl
- @@ -33,6 +33,7 @@ use File::Basename;
- use File::Spec::Functions;
- my $srcRoot = realpath(File::Spec->catfile(dirname(abs_path($0)), ".."));
- +my $incRoot = abs_path($ARGV[0]);
- my @platformPrefixes = ("android", "brew", "cf", "chromium", "curl", "efl", "gtk", "haiku", "mac", "qt", "soup", "v8", "win", "wx");
- my @frameworks = ( "JavaScriptCore", "WebCore", "WebKit2");
- my @skippedPrefixes;
- @@ -40,6 +41,7 @@ my @frameworkHeaders;
- my $framework;
- my %neededHeaders;
- +shift;
- my $outputDirectory = $ARGV[0];
- shift;
- my $platform = $ARGV[0];
- @@ -50,7 +52,7 @@ foreach my $prefix (@platformPrefixes) {
- foreach (@frameworks) {
- $framework = $_;
- - find(\&collectNeededHeaders, File::Spec->catfile($srcRoot, "WebKit2"));
- + find(\&collectNeededHeaders, $incRoot);
- find(\&collectFameworkHeaderPaths, File::Spec->catfile($srcRoot, $framework));
- createForwardingHeadersForFramework();
- }
- diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
- index 94ad556..0218e1f 100644
- --- a/WebKitTools/Scripts/webkitdirs.pm
- +++ b/WebKitTools/Scripts/webkitdirs.pm
- @@ -1530,6 +1530,7 @@ sub buildQMakeProject($@)
- my @subdirs = ("JavaScriptCore", "WebCore", "WebKit/qt/Api");
- if (grep { $_ eq "CONFIG+=webkit2"} @buildArgs) {
- push @subdirs, "WebKit2";
- + push @subdirs, "WebKitTools/WebKitTestRunner/qt";
- }
- for my $subdir (@subdirs) {
- diff --git a/WebKitTools/WebKitTestRunner/PlatformWebView.h b/WebKitTools/WebKitTestRunner/PlatformWebView.h
- index 29c63ae..8aa579a 100644
- --- a/WebKitTools/WebKitTestRunner/PlatformWebView.h
- +++ b/WebKitTools/WebKitTestRunner/PlatformWebView.h
- @@ -26,7 +26,7 @@
- #ifndef PlatformWebView_h
- #define PlatformWebView_h
- -#if __APPLE__
- +#if defined(__APPLE__) && __APPLE__
- #if __OBJC__
- @class WKView;
- @class NSWindow;
- @@ -39,6 +39,9 @@ typedef NSWindow* PlatformWindow;
- #elif defined(WIN32) || defined(_WIN32)
- typedef WKViewRef PlatformWKView;
- typedef HWND PlatformWindow;
- +#elif defined(BUILDING_QT__)
- +typedef QGraphicsWKView* PlatformWKView;
- +typedef QGraphicsWidget* PlatformWindow;
- #endif
- namespace WTR {
- diff --git a/WebKitTools/WebKitTestRunner/qt/DerivedSources.pro b/WebKitTools/WebKitTestRunner/qt/DerivedSources.pro
- new file mode 100644
- index 0000000..52dedd3
- --- /dev/null
- +++ b/WebKitTools/WebKitTestRunner/qt/DerivedSources.pro
- @@ -0,0 +1,18 @@
- +TEMPLATE = lib
- +TARGET = dummy
- +
- +CONFIG -= debug_and_release
- +
- +SRC_ROOT_DIR = $$replace(PWD, /WebKitTools/WebKitTestRunner/qt, /)
- +
- +wtr_fwheader_generator.commands = perl $${SRC_ROOT_DIR}/WebKit2/generate-forwarding-headers.pl $${SRC_ROOT_DIR}/WebKitTools/WebKitTestRunner $${OUTPUT_DIR}/include qt
- +wtr_fwheader_generator.depends = $${SRC_ROOT_DIR}/WebKit2/generate-forwarding-headers.pl
- +generated_files.depends += wtr_fwheader_generator
- +QMAKE_EXTRA_TARGETS += wtr_fwheader_generator
- +
- +jsc_fwheader_generator.commands = perl $${SRC_ROOT_DIR}/WebKit2/generate-forwarding-headers.pl $${SRC_ROOT_DIR}/JavaScriptCore/API $${OUTPUT_DIR}/include qt
- +jsc_fwheader_generator.depends = $${SRC_ROOT_DIR}/WebKit2/generate-forwarding-headers.pl
- +generated_files.depends += jsc_fwheader_generator
- +QMAKE_EXTRA_TARGETS += jsc_fwheader_generator
- +
- +QMAKE_EXTRA_TARGETS += generated_files
- diff --git a/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
- new file mode 100644
- index 0000000..7ce9c7b
- --- /dev/null
- +++ b/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
- @@ -0,0 +1,70 @@
- +/*
- + * Copyright (C) 2010 Apple Inc. All rights reserved.
- + * Copyright (C) 2010 University of Szeged. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- + * OWNER OR 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 "PlatformWebView.h"
- +#include "NotImplemented.h"
- +
- +namespace WTR {
- +
- +static void registerWindowClass()
- +{
- + // Implement
- + notImplemented();
- +}
- +
- +PlatformWebView::PlatformWebView(WKPageNamespaceRef namespaceRef)
- +{
- + registerWindowClass();
- +
- + // Implement
- + notImplemented();
- +}
- +
- +PlatformWebView::~PlatformWebView()
- +{
- + // Implement
- +}
- +
- +void PlatformWebView::resizeTo(unsigned width, unsigned height)
- +{
- + // Implement
- + notImplemented();
- +}
- +
- +WKPageRef PlatformWebView::page()
- +{
- + // Implement
- + notImplemented();
- + return 0;
- +}
- +
- +void PlatformWebView::focus()
- +{
- + // Implement
- + notImplemented();
- +}
- +
- +} // namespace WTR
- diff --git a/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
- new file mode 100644
- index 0000000..9e35a1e
- --- /dev/null
- +++ b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
- @@ -0,0 +1,61 @@
- +/*
- + * Copyright (C) 2010 Apple Inc. All rights reserved.
- + * Copyright (C) 2010 University of Szeged. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- + * OWNER OR 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 "TestController.h"
- +#include "NotImplemented.h"
- +
- +namespace WTR {
- +
- +static void registerWindowClass()
- +{
- + notImplemented();
- +}
- +
- +void TestController::runUntil(bool& done)
- +{
- + notImplemented();
- +}
- +void TestController::platformInitialize()
- +{
- + notImplemented();
- +}
- +
- +void TestController::initializeInjectedBundlePath()
- +{
- + notImplemented();
- +}
- +
- +void TestController::initializeTestPluginDirectory()
- +{
- + notImplemented();
- +}
- +
- +void TestController::platformInitializeContext()
- +{
- + notImplemented();
- +}
- +
- +} // namespace WTR
- diff --git a/WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro b/WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro
- new file mode 100644
- index 0000000..d62a3a2
- --- /dev/null
- +++ b/WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro
- @@ -0,0 +1,67 @@
- +TARGET = WebKitTestRunner
- +CONFIG -= app_bundle
- +
- +BASEDIR = $$PWD/../
- +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
- +
- +include(../../../WebKit.pri)
- +
- +!CONFIG(release, debug|release) {
- + OBJECTS_DIR = obj/debug
- +} else { # Release
- + OBJECTS_DIR = obj/release
- + DEFINES += NDEBUG
- +}
- +
- +DEFINES += USE_SYSTEM_MALLOC
- +
- +INCLUDEPATH += \
- + $$BASEDIR \
- + $$BASEDIR/../../JavaScriptCore \
- + $$BASEDIR/../../WebKit2 \
- + $$BASEDIR/../../WebKit2/Shared \
- +
- +INCLUDEPATH += \
- + $$OUTPUT_DIR/include \
- +
- +
- +DESTDIR = $$OUTPUT_DIR/bin
- +
- +unix:!mac {
- + CONFIG += link_pkgconfig
- + PKGCONFIG += fontconfig
- +}
- +
- +QT = core gui network
- +
- +HEADERS = \
- + $$BASEDIR/PlatformWebView.h \
- + $$BASEDIR/StringFunctions.h \
- + $$BASEDIR/TestController.h \
- + $$BASEDIR/TestInvocation.h
- +
- +SOURCES = \
- + main.cpp \
- + PlatformWebViewQt.cpp \
- + TestControllerQt.cpp \
- + $$BASEDIR/TestController.cpp \
- + $$BASEDIR/TestInvocation.cpp \
- +
- +PREFIX_HEADER = $$BASEDIR/WebKitTestRunnerPrefix.h
- +QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
- +
- +linux-* {
- + # From Creator's src/rpath.pri:
- + # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
- + # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var.
- + QMAKE_RPATHDIR = \$\$ORIGIN/../lib $$QMAKE_RPATHDIR
- + MY_RPATH = $$join(QMAKE_RPATHDIR, ":")
- +
- + QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${MY_RPATH}\'
- + QMAKE_RPATHDIR =
- +} else {
- + QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
- +}
- +
- +include($$BASE_DIR/JavaScriptCore/JavaScriptCore.pri)
- +addJavaScriptCoreLib(../../../JavaScriptCore)
- diff --git a/WebKitTools/WebKitTestRunner/qt/main.cpp b/WebKitTools/WebKitTestRunner/qt/main.cpp
- new file mode 100644
- index 0000000..2523f51
- --- /dev/null
- +++ b/WebKitTools/WebKitTestRunner/qt/main.cpp
- @@ -0,0 +1,34 @@
- +/*
- + * Copyright (C) 2010 Apple Inc. All rights reserved.
- + * Copyright (C) 2010 University of Szeged.
- + *
- + * 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 "TestController.h"
- +
- +int main(int argc, const char* argv[])
- +{
- + WTR::TestController controller(argc, argv);
- +
- + return 0;
- +}
- --
- 1.6.5
Add Comment
Please, Sign In to add comment