Changeset 143197 in webkit
- Timestamp:
- Feb 18, 2013 5:00:00 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r143195 r143197 1 2013-02-15 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 3 [Qt][WK2] Support WK2 API tests 4 https://bugs.webkit.org/show_bug.cgi?id=109843 5 6 Reviewed by Jocelyn Turcotte. 7 8 * UIProcess/API/qt/qquickwebview_p.h: 9 (TestWebKitAPI): 10 1 11 2013-02-18 Andras Becsi <andras.becsi@digia.com> 2 12 -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
r142095 r143197 46 46 47 47 namespace WTR { 48 class PlatformWebView; 49 } 50 51 namespace TestWebKitAPI { 48 52 class PlatformWebView; 49 53 } … … 225 229 friend class WebKit::QtWebPageUIClient; 226 230 friend class WTR::PlatformWebView; 231 friend class TestWebKitAPI::PlatformWebView; 227 232 friend class QQuickWebViewExperimental; 228 233 }; -
trunk/Tools/ChangeLog
r143190 r143197 1 2013-02-15 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 3 [Qt][WK2] Support WK2 API tests 4 https://bugs.webkit.org/show_bug.cgi?id=109843 5 6 Reviewed by Jocelyn Turcotte. 7 8 * TestWebKitAPI/DerivedSources.pri: Added. 9 * TestWebKitAPI/InjectedBundle.pri: Added. 10 * TestWebKitAPI/PlatformWebView.h: 11 * TestWebKitAPI/TestWebKitAPI.pri: 12 * TestWebKitAPI/TestWebKitAPI.pro: 13 * TestWebKitAPI/Tests/JavaScriptCore/JavaScriptCore.pro: Added. 14 * TestWebKitAPI/Tests/WTF/WTF.pro: 15 * TestWebKitAPI/Tests/WebKit2/WebKit2.pro: Added. 16 * TestWebKitAPI/qt/PlatformUtilitiesQt.cpp: 17 (TestWebKitAPI::Util::sleep): 18 (TestWebKitAPI::Util::createInjectedBundlePath): 19 (TestWebKitAPI::Util::createURLForResource): 20 (TestWebKitAPI::Util::isKeyDown): 21 (Util): 22 * TestWebKitAPI/qt/PlatformWebViewQt.cpp: Added. 23 (TestWebKitAPI): 24 (WrapperWindow): 25 (TestWebKitAPI::WrapperWindow::WrapperWindow): 26 (TestWebKitAPI::WrapperWindow::handleStatusChanged): 27 (TestWebKitAPI::PlatformWebView::PlatformWebView): 28 (TestWebKitAPI::PlatformWebView::~PlatformWebView): 29 (TestWebKitAPI::PlatformWebView::resizeTo): 30 (TestWebKitAPI::PlatformWebView::page): 31 (TestWebKitAPI::PlatformWebView::focus): 32 (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress): 33 (TestWebKitAPI::PlatformWebView::simulateAltKeyPress): 34 (TestWebKitAPI::PlatformWebView::simulateMouseMove): 35 (TestWebKitAPI::PlatformWebView::simulateRightClick): 36 * TestWebKitAPI/qt/main.cpp: 37 (addQtWebProcessToPath): 38 (main): 39 1 40 2013-02-18 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 41 -
trunk/Tools/TestWebKitAPI/PlatformWebView.h
r141836 r143197 51 51 typedef WKViewRef PlatformWKView; 52 52 typedef Ecore_Evas* PlatformWindow; 53 #elif PLATFORM(QT) 54 QT_BEGIN_NAMESPACE 55 class QQuickView; 56 QT_END_NAMESPACE 57 class QQuickWebView; 58 typedef QQuickWebView* PlatformWKView; 59 typedef QQuickView* PlatformWindow; 53 60 #endif 54 61 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.pri
r142070 r143197 1 1 2 2 INCLUDEPATH += $$PWD $${ROOT_WEBKIT_DIR}/Source/ThirdParty/gtest/include 3 WEBKIT += wtf javascriptcore 3 WEBKIT += wtf javascriptcore webkit2 4 4 5 5 DEFINES += QT_NO_CAST_FROM_ASCII 6 6 7 QT += core gui webkit7 QT += core core-private gui gui-private webkit quick quick-private 8 8 9 9 CONFIG += compiling_thirdparty_code 10 10 11 SOURCES += $$PWD/*.cpp 12 SOURCES += $$PWD/qt/*.cpp 11 SOURCES += \ 12 $$PWD/JavaScriptTest.cpp \ 13 $$PWD/PlatformUtilities.cpp \ 14 $$PWD/TestsController.cpp \ 15 $$PWD/qt/main.cpp \ 16 $$PWD/qt/PlatformUtilitiesQt.cpp \ 17 $$PWD/qt/PlatformWebViewQt.cpp 13 18 14 19 LIBS += -L$${ROOT_BUILD_DIR}/Source/ThirdParty/gtest/$$activeBuildConfig() -lgtest 20 21 DEFINES += ROOT_BUILD_DIR=\\\"$${ROOT_BUILD_DIR}\\\" 22 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.pro
r142070 r143197 1 1 TEMPLATE = subdirs 2 CONFIG += ordered 2 3 3 SUBDIRS += Tests/WTF 4 derived_sources.file = DerivedSources.pri 5 injected_bundle.file = InjectedBundle.pri 6 tests.file = Tests.pri 7 8 SUBDIRS += derived_sources injected_bundle tests 9 10 addStrictSubdirOrderBetween(derived_sources, injected_bundle) 11 addStrictSubdirOrderBetween(derived_sources, tests) -
trunk/Tools/TestWebKitAPI/Tests/WTF/WTF.pro
r142070 r143197 19 19 StringOperators.cpp \ 20 20 TemporaryChange.cpp \ 21 Vector.cpp \ 21 22 VectorBasic.cpp \ 22 Vector.cpp \23 23 VectorReverse.cpp \ 24 24 WTFString.cpp 25 25 26 26 include(../../TestWebKitAPI.pri) 27 28 DEFINES += APITEST_SOURCE_DIR=\\\"$$PWD\\\" 29 -
trunk/Tools/TestWebKitAPI/qt/PlatformUtilitiesQt.cpp
r142070 r143197 22 22 #include "PlatformUtilities.h" 23 23 24 #include <WebKit2/WKStringQt.h> 25 #include <WebKit2/WKNativeEvent.h> 26 #include <WebKit2/WKURLQt.h> 27 24 28 #include <QCoreApplication> 25 26 #include <unistd.h> 29 #include <QDir> 30 #include <QUrl> 31 #include <QThread> 27 32 28 33 namespace TestWebKitAPI { … … 37 42 void sleep(double seconds) 38 43 { 39 usleep(seconds * 1000000);44 QThread::sleep(seconds); 40 45 } 41 46 42 47 WKStringRef createInjectedBundlePath() 43 48 { 44 // ### FIXME. 45 return WKStringCreateWithUTF8CString(""); 49 QString path = QFileInfo(QStringLiteral(ROOT_BUILD_DIR "/lib/libTestWebKitAPIInjectedBundle")).absoluteFilePath(); 50 51 return WKStringCreateWithQString(path); 46 52 } 47 53 48 54 WKURLRef createURLForResource(const char* resource, const char* extension) 49 55 { 50 // ### FIXME. 51 return WKURLCreateWithUTF8CString(""); 56 QDir path(QStringLiteral(APITEST_SOURCE_DIR)); 57 QString filename = QString::fromLocal8Bit(resource) + QStringLiteral(".") + QString::fromLocal8Bit(extension); 58 59 return WKURLCreateWithQUrl(QUrl::fromLocalFile(path.absoluteFilePath(filename))); 52 60 } 53 61 … … 57 65 } 58 66 67 bool isKeyDown(WKNativeEventPtr event) 68 { 69 return event->type() == QEvent::KeyPress; 70 } 71 59 72 } // namespace Util 60 73 } // namespace TestWebKitAPI -
trunk/Tools/TestWebKitAPI/qt/main.cpp
r142070 r143197 22 22 #include "TestsController.h" 23 23 24 #include "qquickwebview_p.h" 24 25 #include <QGuiApplication> 26 27 void addQtWebProcessToPath() 28 { 29 // Since tests won't find ./QtWebProcess, add it to PATH (at the end to prevent surprises). 30 // ROOT_BUILD_DIR should be defined by qmake. 31 qputenv("PATH", qgetenv("PATH") + QByteArray(":" ROOT_BUILD_DIR "/bin")); 32 } 33 34 void messageHandler(QtMsgType type, const QMessageLogContext&, const QString& message) 35 { 36 if (type == QtCriticalMsg) { 37 fprintf(stderr, "%s\n", qPrintable(message)); 38 return; 39 } 40 41 // Do nothing 42 } 25 43 26 44 int main(int argc, char** argv) 27 45 { 46 bool suppressQtDebugOutput = true; // Suppress debug output from Qt if not started with --verbose. 47 bool useDesktopBehavior = true; // Use traditional desktop behavior if not started with --flickable. 48 49 for (int i = 1; i < argc; ++i) { 50 if (!qstrcmp(argv[i], "--verbose")) 51 suppressQtDebugOutput = false; 52 else if (!qstrcmp(argv[i], "--flickable")) 53 useDesktopBehavior = false; 54 } 55 56 QQuickWebViewExperimental::setFlickableViewportEnabled(!useDesktopBehavior); 57 58 // Has to be done before QApplication is constructed in case 59 // QApplication itself produces debug output. 60 if (suppressQtDebugOutput) { 61 qInstallMessageHandler(messageHandler); 62 if (qgetenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT").isEmpty()) 63 qputenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT", "1"); 64 } 65 28 66 QGuiApplication app(argc, argv); 67 addQtWebProcessToPath(); 29 68 30 69 return TestWebKitAPI::TestsController::shared().run(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE;
Note: See TracChangeset
for help on using the changeset viewer.