Skip to content

Instantly share code, notes, and snippets.

@zenoalbisser
Created November 9, 2012 17:07
Show Gist options
  • Select an option

  • Save zenoalbisser/4046887 to your computer and use it in GitHub Desktop.

Select an option

Save zenoalbisser/4046887 to your computer and use it in GitHub Desktop.
commit 314dddd554ba3b7eb8f098214463afd932a13f8f
Author: Zeno Albisser <zeno@webkit.org>
Date: Fri Nov 9 17:46:30 2012 +0100
add configure flag for building qttestsupport
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index 54aed13..2aff245 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -4076,7 +4076,7 @@ use?(GRAPHICS_SURFACE) {
}
}
-if(build?(drt)|build?(wtr)) {
+if(build?(qttestsupport)) {
HEADERS += platform/qt/QtTestSupport.h
SOURCES += platform/qt/QtTestSupport.cpp
}
diff --git a/Source/WebCore/platform/qt/QtTestSupport.h b/Source/WebCore/platform/qt/QtTestSupport.h
index dc40293..9e66683 100644
--- a/Source/WebCore/platform/qt/QtTestSupport.h
+++ b/Source/WebCore/platform/qt/QtTestSupport.h
@@ -24,6 +24,8 @@
#include <QtCore/qglobal.h>
+#if HAVE(QTTESTSUPPORT)
+
#if defined(BUILDING_WEBKIT)
#define TESTSUPPORT_EXPORT Q_DECL_EXPORT
#else
@@ -45,4 +47,6 @@ TESTSUPPORT_EXPORT void initializeTestFonts();
}
+#endif // HAVE(QTTESTSUPPORT)
+
#endif
diff --git a/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp b/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp
index ec919a6..45001ec 100644
--- a/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp
+++ b/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp
@@ -26,6 +26,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "config.h"
+
#include "MiniBrowserApplication.h"
#include "BrowserWindow.h"
@@ -37,6 +39,7 @@
#include <QMouseEvent>
#include <QTouchEvent>
+
static inline QRectF touchRectForPosition(QPointF centerPoint)
{
QRectF touchRect(0, 0, 40, 40);
@@ -334,8 +337,10 @@ void MiniBrowserApplication::handleUserOptions()
m_windowOptions.setRequestedWindowSize(QSize(list.at(0).toInt(), list.at(1).toInt()));
}
+#if HAVE(QTTESTSUPPORT)
if (takeOptionFlag(&args, QStringLiteral("--use-test-fonts")))
WebKit::QtTestSupport::initializeTestFonts();
+#endif
if (args.contains("-r")) {
QString listFile = takeOptionValue(&args, "-r");
diff --git a/Tools/qmake/mkspecs/features/configure.prf b/Tools/qmake/mkspecs/features/configure.prf
index 3954a94..81b6f0e 100644
--- a/Tools/qmake/mkspecs/features/configure.prf
+++ b/Tools/qmake/mkspecs/features/configure.prf
@@ -17,7 +17,8 @@ WEBKIT_TOOLS_CONFIG = \
build_imagediff \
build_test_npapi \
build_testbrowser \
- build_minibrowser
+ build_minibrowser \
+ build_qttestsupport
defineTest(runConfigure) {
!webkit_configured:!print_defaults {
diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf
index bc285a2..0212e79 100644
--- a/Tools/qmake/mkspecs/features/features.prf
+++ b/Tools/qmake/mkspecs/features/features.prf
@@ -134,6 +134,10 @@ defineTest(detectFeatures) {
# Slider Touch is sensible to use when compiling WebKit2
enable?(touch_events): WEBKIT_CONFIG += touch_slider
+
+ # Minibrowser must be able to query for QtTestSupport
+ build?(qttestsupport): WEBKIT_CONFIG += have_qttestsupport
+
# ---------------- Sanitize features -------------------
export(WEBKIT_CONFIG)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment