diff options
Diffstat (limited to 'Source/WebKit/qt/tests')
-rw-r--r-- | Source/WebKit/qt/tests/CMakeLists.txt | 21 | ||||
-rw-r--r-- | Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.qrc (renamed from Source/WebKit/qt/tests/hybridPixmap/resources.qrc) | 0 | ||||
-rw-r--r-- | Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 23 | ||||
-rw-r--r-- | Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp | 23 |
4 files changed, 57 insertions, 10 deletions
diff --git a/Source/WebKit/qt/tests/CMakeLists.txt b/Source/WebKit/qt/tests/CMakeLists.txt index 8c96f4cbf..685896bfe 100644 --- a/Source/WebKit/qt/tests/CMakeLists.txt +++ b/Source/WebKit/qt/tests/CMakeLists.txt @@ -1,26 +1,23 @@ cmake_minimum_required(VERSION 2.8.12) include_directories( - "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/Source" "${DERIVED_SOURCES_DIR}/ForwardingHeaders" - "${DERIVED_SOURCES_WEBKIT_DIR}" - "${WEBCORE_DIR}" - "${WEBCORE_DIR}/platform" - "${WEBCORE_DIR}/platform/qt" "${WEBKIT_DIR}/qt/Api" "${WEBKIT_DIR}/qt/WidgetApi" - - "${JAVASCRIPTCORE_DIR}" - "${WTF_DIR}" ) include_directories(SYSTEM ${ICU_INCLUDE_DIRS} + ${Qt5Gui_PRIVATE_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Test_INCLUDE_DIRS} ) +if (ENABLE_TEST_SUPPORT) + add_definitions(-DHAVE_QTTESTSUPPORT) +endif () + set(QtWK1ApiTests_LIBRARIES ${Qt5Gui_LIBRARIES} ${Qt5Network_LIBRARIES} @@ -35,6 +32,7 @@ set(QtWK1ApiTests_RUNTIME_OUTPUT_DIRECTORY ) set(QtWK1ApiTests + hybridPixmap qgraphicswebview qobjectbridge qwebelement @@ -42,18 +40,23 @@ set(QtWK1ApiTests qwebhistory qwebhistoryinterface qwebinspector + qwebpage qwebsecurityorigin qwebview ) +set(tst_hybridPixmap_SOURCES hybridPixmap/widget.cpp) +qt5_wrap_ui(tst_hybridPixmap_SOURCES hybridPixmap/widget.ui) + if (ENABLE_API_TESTS) foreach (testName ${QtWK1ApiTests}) - set(tst_${testName}_SOURCES ${testName}/tst_${testName}.cpp) + list(APPEND tst_${testName}_SOURCES ${testName}/tst_${testName}.cpp) if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${testName}/tst_${testName}.qrc") qt5_add_resources(tst_${testName}_SOURCES ${testName}/tst_${testName}.qrc) endif () add_executable(tst_${testName} ${tst_${testName}_SOURCES}) + target_include_directories(tst_${testName} PRIVATE ${testName}) target_link_libraries(tst_${testName} ${QtWK1ApiTests_LIBRARIES}) set_target_properties(tst_${testName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${QtWK1ApiTests_RUNTIME_OUTPUT_DIRECTORY}) diff --git a/Source/WebKit/qt/tests/hybridPixmap/resources.qrc b/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.qrc index 5fd47e32d..5fd47e32d 100644 --- a/Source/WebKit/qt/tests/hybridPixmap/resources.qrc +++ b/Source/WebKit/qt/tests/hybridPixmap/tst_hybridPixmap.qrc diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 6e239f67d..bef98fee6 100644 --- a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -20,7 +20,6 @@ */ #include "../util.h" -#include "../WebCoreSupport/DumpRenderTreeSupportQt.h" #include <QClipboard> #include <QDir> #include <QGraphicsWidget> @@ -50,6 +49,10 @@ #include <qwebview.h> #include <qimagewriter.h> +#ifdef HAVE_QTTESTSUPPORT +#include "../WebCoreSupport/DumpRenderTreeSupportQt.h" +#endif + static void removeRecursive(const QString& dirname) { QDir dir(dirname); @@ -110,7 +113,11 @@ public Q_SLOTS: private Q_SLOTS: void initTestCase(); void cleanupTestCase(); + +#ifdef HAVE_QTTESTSUPPORT void thirdPartyCookiePolicy(); +#endif + void contextMenuCopy(); void contextMenuPopulatedOnce(); void acceptNavigationRequest(); @@ -135,7 +142,11 @@ private Q_SLOTS: void createViewlessPlugin_data(); void createViewlessPlugin(); void graphicsWidgetPlugin(); + +#ifdef HAVE_QTTESTSUPPORT void multiplePageGroupsAndLocalStorage(); +#endif + void cursorMovements(); void textSelection(); void textEditing(); @@ -143,7 +154,11 @@ private Q_SLOTS: void frameAt(); void requestCache(); void loadCachedPage(); + +#ifdef HAVE_QTTESTSUPPORT void protectBindingsRuntimeObjectsFromCollector(); +#endif + void localURLSchemes(); void testOptionalJSObjects(); void testLocalStorageVisibility(); @@ -1089,6 +1104,7 @@ void tst_QWebPage::createViewlessPlugin() } +#ifdef HAVE_QTTESTSUPPORT void tst_QWebPage::multiplePageGroupsAndLocalStorage() { QDir dir(tmpDirPath()); @@ -1130,6 +1146,7 @@ void tst_QWebPage::multiplePageGroupsAndLocalStorage() dir.rmdir(QDir::toNativeSeparators("./path1")); dir.rmdir(QDir::toNativeSeparators("./path2")); } +#endif class CursorTrackedPage : public QWebPage { @@ -2449,6 +2466,7 @@ void tst_QWebPage::inputMethodsTextFormat() delete view; } +#ifdef HAVE_QTTESTSUPPORT void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector() { QSignalSpy loadSpy(m_view, SIGNAL(loadFinished(bool))); @@ -2470,6 +2488,7 @@ void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector() // don't crash! newPage->mainFrame()->evaluateJavaScript("testme('bar')"); } +#endif void tst_QWebPage::localURLSchemes() { @@ -3133,6 +3152,7 @@ void tst_QWebPage::navigatorCookieEnabled() QVERIFY(m_page->mainFrame()->evaluateJavaScript("navigator.cookieEnabled").toBool()); } +#ifdef HAVE_QTTESTSUPPORT void tst_QWebPage::thirdPartyCookiePolicy() { QWebSettings::globalSettings()->setThirdPartyCookiePolicy(QWebSettings::AlwaysBlockThirdPartyCookies); @@ -3171,6 +3191,7 @@ void tst_QWebPage::thirdPartyCookiePolicy() QVERIFY(!DumpRenderTreeSupportQt::thirdPartyCookiePolicyAllows(m_page->handle(), QUrl("http://anotherexample.co.uk"), QUrl("http://example.co.uk"))); } +#endif #ifdef Q_OS_MAC void tst_QWebPage::macCopyUnicodeToClipboard() diff --git a/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp index 3824dda7b..f4db608d4 100644 --- a/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp +++ b/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp @@ -59,6 +59,7 @@ private Q_SLOTS: void setPalette_data(); void setPalette(); #endif + void innerOuterRect(); }; // This will be called before the first test function is executed. @@ -518,6 +519,28 @@ void tst_QWebView::renderingAfterMaxAndBack() QCOMPARE(image3, reference3); } +void tst_QWebView::innerOuterRect() +{ + QUrl url = QUrl("data:text/html,<html><head></head>" + "<body bgcolor=red>" + "</body>" + "</html>"); + QWebView view; + view.page()->mainFrame()->load(url); + QVERIFY(waitForSignal(&view, SIGNAL(loadFinished(bool)))); + view.showMaximized(); + const QRect frameGeometry = view.frameGeometry(); + const QRect geometry = view.geometry(); + QVariant outerWidth = view.page()->mainFrame()->evaluateJavaScript("window.outerWidth;"); + QCOMPARE(outerWidth.toInt(), frameGeometry.width()); + QVariant innerWidth = view.page()->mainFrame()->evaluateJavaScript("window.innerWidth;"); + QCOMPARE(innerWidth.toInt(), geometry.width()); + QVariant outerHeight = view.page()->mainFrame()->evaluateJavaScript("window.outerHeight;"); + QCOMPARE(outerHeight.toInt(), frameGeometry.height()); + QVariant innerHeight = view.page()->mainFrame()->evaluateJavaScript("window.innerHeight;"); + QCOMPARE(innerHeight.toInt(), geometry.height()); +} + QTEST_MAIN(tst_QWebView) #include "tst_qwebview.moc" |