summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/tests
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-09-18 08:35:59 (GMT)
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-09-18 08:38:07 (GMT)
commitef310719ef42cd09e2542fce96c529b5657bf167 (patch)
treec691bab10518e479ce40d4cac6c79daa312fce87 /src/3rdparty/webkit/WebKit/qt/tests
parent5b828316abb0ad1a33cdc11ebac0999d9b79576a (diff)
downloadQt-ef310719ef42cd09e2542fce96c529b5657bf167.zip
Qt-ef310719ef42cd09e2542fce96c529b5657bf167.tar.gz
Qt-ef310719ef42cd09e2542fce96c529b5657bf167.tar.bz2
Updated WebKit from /home/joce/dev/qtwebkit/ to qtwebkit-4.6-snapshot-18092009 ( 15c07fb8d7fa5e93c939aa7eb21c06e19c754cee )
Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com> Reviewed by Simon Hausmann. Symbian build fix. Moved the #ifdefs around _q_cleanupLeakMessages() into the function definition. QMake is not being able to distinguish between release and debug builds in Symbian build. This is a Symbian toolchain issue. * Api/qwebpage.cpp: (QWebPagePrivate::_q_cleanupLeakMessages): * Api/qwebpage.h: * Api/qwebpage_p.h: 2009-09-17 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed by Simon Hausmann. Small cosmetic documentation fixlet in the QWebInspector. * Api/qwebinspector.cpp: 2009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com> Reviewed by Eric Seidel. Detect and add Windows7 properly to the user agent. * Api/qwebpage.cpp: (QWebPage::userAgentForUrl): 2009-09-16 Andras Becsi <andrewbecsi@yahoo.co.uk> Rubberstamped by Kenneth Christiansen. [Qt] Build fix for previous changes. * QGVLauncher/main.cpp: (MainView::flip): 2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org> Unreviewed potential Qt < 4.6 build fix. * QGVLauncher/main.cpp: (MainView::flip): 2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann. Add a "Flip effect" to our GraphicsView based launcher. * QGVLauncher/main.cpp: (MainView::resizeEvent): (MainView::flip): (MainWindow::flip): (MainWindow::buildUI): 2009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> Rubber-stamped by Simon Hausmann. [Qt] Typo fix. Pass the window object to the Format menu. In this way Qt can free its internal graphical objects during exit. * QtLauncher/main.cpp: (MainWindow::setupUI): 2009-09-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed by Tor Arne Vestbø. [Qt] Build break fix on gcc ARM. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItemPrivate::_q_doLoadProgress): 2009-09-16 Warwick Allison <warwick.allison@nokia.com> Reviewed by Simon Hausmann. Fix a crash in QWebFrame::hasFocus() with a simple null pointer check when the focused frame is null. We do the same check in other places where we call kit(). * Api/qwebframe.cpp: (QWebFrame::hasFocus): 2009-09-16 Jure Repinc <jlp@holodeck1.com> Reviewed by Simon Hausmann. Fixed a typo found during translation. * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): 2009-09-14 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. [Qt] QWebGraphicsItem should check for null QWebPage. https://bugs.webkit.org/show_bug.cgi?id=29185 Don't crash in QWebGraphicsItem when the page is still null, by either checking if it's the case or constructing the default one. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::icon): (QWebGraphicsItem::setZoomFactor): (QWebGraphicsItem::zoomFactor): (QWebGraphicsItem::setGeometry): (QWebGraphicsItem::load): (QWebGraphicsItem::setHtml): (QWebGraphicsItem::toHtml): (QWebGraphicsItem::setContent): (QWebGraphicsItem::history): (QWebGraphicsItem::settings): 2009-09-11 David Boddie <dboddie@trolltech.com> Reviewed by Simon Hausmann. Doc: Note that Netscape plugins are only available on desktop platforms. * docs/qtwebkit.qdoc: 2009-09-11 Martin Smith <msmith@trolltech.com> Reviewed by Simon Hausmann. Adjust the name of the contentspage for the documentation to the new name used in Qt 4.6. * docs/qtwebkit.qdoc: 2009-09-11 Ariya Hidayat <ariya.hidayat@nokia.com> Reviewed by Simon Hausmann. Changed URLs from qtsoftware.com to qt.nokia.com, as part of a general renaming. * Api/qwebpluginfactory.cpp: * docs/webkitsnippets/simple/main.cpp: (main): * docs/webkitsnippets/webpage/main.cpp: (main): 2009-09-11 Volker Hilsheimer <volker.hilsheimer@nokia.com> Reviewed by Simon Hausmann. Restructure the documentation, both on a file and on a content level. * Api/qwebdatabase.cpp: * Api/qwebelement.cpp: * Api/qwebframe.cpp: * Api/qwebhistory.cpp: * Api/qwebhistoryinterface.cpp: * Api/qwebpage.cpp: * Api/qwebpluginfactory.cpp: * Api/qwebsecurityorigin.cpp: * Api/qwebsettings.cpp: * Api/qwebview.cpp: * docs/qtwebkit.qdoc: 2009-09-11 Yongjun Zhang <yongjun.zhang@nokia.com> Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=29136 [Qt] emit microFocusChanged() signal when no QWidget-based view is present. emit microFocusChange() signal regardless of view. * WebCoreSupport/EditorClientQt.cpp: (WebCore::EditorClientQt::setInputMethodState): 2009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=28806 [Qt] Make the WebInspector available as a QWidget. * Api/headers.pri: * Api/qwebelement.cpp: (QWebElement::enclosingElement): * Api/qwebelement.h: * Api/qwebinspector.cpp: Added. * Api/qwebinspector.h: Added. * Api/qwebinspector_p.h: Added. * Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate): (QWebPagePrivate::setInspector): (QWebPagePrivate::getOrCreateInspector): (QWebPagePrivate::inspectorController): (QWebPage::~QWebPage): (QWebPage::triggerAction): * Api/qwebpage.h: * Api/qwebpage_p.h: * Api/qwebsettings.cpp: * QtLauncher/main.cpp: (MainWindow::MainWindow): * WebCoreSupport/InspectorClientQt.cpp: (WebCore::InspectorClientWebPage::InspectorClientWebPage): (WebCore::InspectorClientWebPage::createWindow): (WebCore::InspectorClientQt::createPage): (WebCore::InspectorClientQt::showWindow): (WebCore::InspectorClientQt::closeWindow): (WebCore::InspectorClientQt::attachWindow): (WebCore::InspectorClientQt::detachWindow): (WebCore::InspectorClientQt::updateWindowTitle): * WebCoreSupport/InspectorClientQt.h: * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: Added. 2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Eric Seidel. [Qt] Fix comparison between signed and unsigned integer warnings https://bugs.webkit.org/show_bug.cgi?id=29162 No functional change. * Api/qwebelement.cpp: (QWebElement::findAll): * Api/qwebhistory.cpp: (QWebHistory::items): (QWebHistory::backItems): (QWebHistory::forwardItems): (QWebHistory::saveState): * Api/qwebplugindatabase.cpp: (QWebPluginDatabase::setSearchPaths): * WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::runOpenPanel): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::createPlugin): 2009-09-10 Simon Hausmann <hausmann@webkit.org> Rubber-stamped by Ariya Hidayat. Fix a bunch of qdoc warnings: Invalid references, non-standard wording, etc. * Api/qwebelement.cpp: * Api/qwebgraphicsitem.cpp: * Api/qwebsecurityorigin.cpp: 2009-09-10 Simon Hausmann <hausmann@webkit.org> Reviewed by Ariya Hidayat. Fix context menu event delivery with QWebGraphicsItem. Re-implement the correct context menu virtual function using a QGraphicsSceneContextMenuEvent and forward & handle it in QWebPage. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::contextMenuEvent): * Api/qwebgraphicsitem.h: * Api/qwebpage.cpp: (QWebPagePrivate::contextMenuEvent): (QWebPage::event): * Api/qwebpage_p.h: 2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> Unreviewed. Build fix for QtWebKit for Mac after r48219. qevent and qstyleoption are QtGui interfaces. * Api/qwebgraphicsitem.cpp: * Api/qwebgraphicsitem.h: 2009-09-09 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Call the right base class function QGraphicsWidget::event() instead of skipping it and using QObject::event() instead. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::event): 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org> Unreviewed. Fix comment at Tor Arne Vestbø's request. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::sceneEvent): (QWebGraphicsItem::event): 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Tor Arne Vestbø. Implement some virtual event methods so that we can fix event-related bugs in Qt patch releases. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::sceneEvent): (QWebGraphicsItem::event): * Api/qwebgraphicsitem.h: 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>, Antonio Gomes <antonio.gomes@openbossa.org> Reviewed by Simon Hausmann. Add a new QGraphicsWidget based version of the "QWebView" under the name "QWebGraphicsItem". https://bugs.webkit.org/show_bug.cgi?id=28862 Includes an alternative Qt launcher using the QGraphicsView. * Api/headers.pri: * Api/qwebgraphicsitem.cpp: Added. * Api/qwebgraphicsitem.h: Added. * Api/qwebpage.h: * QGVLauncher/QGVLauncher.pro: Copied from WebKit/qt/QtLauncher/QtLauncher.pro. * QGVLauncher/main.cpp: Added. * WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::repaint): (WebCore::ChromeClientQt::scroll): 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> Unreviewed build fix. Potential build fix for Qt 4.5 * Api/qwebpage.cpp: (QWebPagePrivate::mousePressEvent): 2009-09-08 Benjamin Poulain <benjamin.poulain@nokia.com> Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=29007 Add a test for the signal QWebFrame::javaScriptWindowObjectCleared() * tests/qwebframe/tst_qwebframe.cpp: 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Simon Hausmann. [Qt] Fix unused variable warnings https://bugs.webkit.org/show_bug.cgi?id=29018 * Api/qwebpage.cpp: (QWebPagePrivate::keyPressEvent): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::startDownload): (WebCore::FrameLoaderClientQt::createFrame): 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Ariya Hidayat. [Qt] Use the declaration order in initializer lists https://bugs.webkit.org/show_bug.cgi?id=29017 * Api/qwebframe_p.h: 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann. Add support for handling QGraphicsScene events. * Api/qwebpage.cpp: (QWebPagePrivate::mouseMoveEvent): (QWebPagePrivate::mousePressEvent): (QWebPagePrivate::mouseDoubleClickEvent): (QWebPagePrivate::mouseTripleClickEvent): (QWebPagePrivate::handleClipboard): (QWebPagePrivate::mouseReleaseEvent): (QWebPagePrivate::wheelEvent): (QWebPagePrivate::dragEnterEvent): (QWebPagePrivate::dragLeaveEvent): (QWebPagePrivate::dragMoveEvent): (QWebPagePrivate::dropEvent): (QWebPage::event): * Api/qwebpage_p.h: 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann. [Qt] Make cursor set cleaner in QtWebKit Api: eliminate SetCursorEvent hack. https://bugs.webkit.org/show_bug.cgi?id=28865 Clean up the unserCursor hack to use the QCursor set as a property of the QWidget by WebCore::WidgetQt. Remove all code that are no longer necessary for getting cursor change events. Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> and Antonio Gomes <antonio.gomes@openbossa.org> on 2009-09-07 * Api/qwebpage.cpp: * Api/qwebpage_p.h: * Api/qwebview.cpp: (QWebViewPrivate::QWebViewPrivate): (QWebView::event): 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Simon Hausmann. [Qt] QtWebKit single API to enable persistency https://bugs.webkit.org/show_bug.cgi?id=28682 Disable LocalStorage, ApplicationCache, HTML5 offline storage by default. If persistency is enabled the default directory for LocalStorage and ApplicationCache is now based on QDesktopServices::DataLocation and not QDesktopServices::CacheLocation (as it is expected to keep this data around after a reboot). If persistency is enabled initialize HTML5 offline storage as well - this fixed offline Storage for QtLauncher. * Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate): * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): (QWebSettings::enablePersistentStorage): * Api/qwebsettings.h: Add a new API called enablePersistentStorage * QtLauncher/main.cpp: Use the new enablePersistentStorage API (main): 2009-09-07 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. Speed up the QWebPluginInfo::supportsMimeType() function. https://bugs.webkit.org/show_bug.cgi?id=27651 Instead of going through the MIME types list constructed with mimeTypes() function, look up the internal mimeToDescriptions map. * Api/qwebplugindatabase.cpp: (QWebPluginInfo::supportsMimeType): 2009-09-07 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. Speed up the QWebPluginInfo::mimeTypes() function. https://bugs.webkit.org/show_bug.cgi?id=27651 Instead of constructing a list of MIME types every time it is called, do this only once. * Api/qwebplugindatabase.cpp: (QWebPluginInfo::mimeTypes): (QWebPluginInfo::operator=): * Api/qwebplugindatabase.h: * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: (tst_QWebPluginDatabase::operatorassign_data): (tst_QWebPluginDatabase::operatorassign): 2009-09-07 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. Remove the private classes from QWebPluginDatabase. https://bugs.webkit.org/show_bug.cgi?id=27651 Instead, hold the PluginDatabase and PluginPackage objects as class members and take care of refcounting on our own instead of using RefPtr. This way we not only made the code cleaner but also got rid of redundant allocations when constructing null QWebPluginInfo objects. The private classes have been forward-declared and the d-pointers left to be on the safe side. * Api/qwebplugindatabase.cpp: (QWebPluginInfo::QWebPluginInfo): (QWebPluginInfo::~QWebPluginInfo): (QWebPluginInfo::name): (QWebPluginInfo::description): (QWebPluginInfo::mimeTypes): (QWebPluginInfo::path): (QWebPluginInfo::isNull): (QWebPluginInfo::setEnabled): (QWebPluginInfo::isEnabled): (QWebPluginInfo::operator==): (QWebPluginInfo::operator!=): (QWebPluginInfo::operator=): (QWebPluginDatabase::QWebPluginDatabase): (QWebPluginDatabase::~QWebPluginDatabase): (QWebPluginDatabase::plugins): (QWebPluginDatabase::searchPaths): (QWebPluginDatabase::setSearchPaths): (QWebPluginDatabase::addSearchPath): (QWebPluginDatabase::refresh): (QWebPluginDatabase::pluginForMimeType): (QWebPluginDatabase::setPreferredPluginForMimeType): * Api/qwebplugindatabase.h: * Api/qwebplugindatabase_p.h: Removed. 2009-09-05 Jakub Wieczorek <faw217@gmail.com> Reviewed by Eric Seidel. [Qt] r47424 broke binary compatibility https://bugs.webkit.org/show_bug.cgi?id=28996 Append the new DnsPrefetchEnabled attribute at the end of the enum. * Api/qwebsettings.h: 2009-09-04 Mark Mentovai <mark@chromium.org> Reviewed by Dave Hyatt. https://bugs.webkit.org/show_bug.cgi?id=28614 Account for scrollbar state changes that occur during layout. * Api/qwebframe.cpp: (QWebFrame::setScrollBarPolicy): Eliminate duplicated (and incorrect) scrollbar mode tracking between FrameView and ScrollView. 2009-09-04 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Eric Seidel. [Qt] Fix tst_QWebPage::database autotest failure https://bugs.webkit.org/show_bug.cgi?id=28961 Make sure that the test case enables the feature before the feature gets tested * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::database): 2009-09-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com> Reviewed by Eric Seidel. Any QtWebKit application crashes on exit if the inspector is used during the session rather then exiting. If a QWebView has a QWebPage that is destroyed the QWebView does not update its pointer and will crash the next time it access the page pointers (such as in its destructor). InspectorClientView should not call deleteLater when the page is destroyed because it does not have a parent and is a top level widget. close() needs to be called so that QApplication can exit the application if quitOnLastWindowClosed is set and a InspectorClientView is the last window, otherwise the application will never exit. * Api/qwebview.cpp: (QWebViewPrivate::_q_pageDestroyed): (QWebView::setPage): * Api/qwebview.h: * WebCoreSupport/InspectorClientQt.cpp: (WebCore::InspectorClientView::InspectorClientView): 2009-09-03 Adam Barth <abarth@webkit.org> Reviewed by eric@webkit.org. https://bugs.webkit.org/show_bug.cgi?id=24696 Stub implementations of mixed content methods of FrameLoaderClient. * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::didDisplayInsecureContent): (WebCore::FrameLoaderClientQt::didRunInsecureContent): * WebCoreSupport/FrameLoaderClientQt.h: 2009-09-03 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Eric Seidel. [Qt] Add a setting to turn SessionStorage on/off https://bugs.webkit.org/show_bug.cgi?id=28836 * Api/qwebsettings.cpp: (QWebSettingsPrivate::apply): (QWebSettings::QWebSettings): * Api/qwebsettings.h: * tests/qwebpage/tst_qwebpage.cpp: (testFlag): (tst_QWebPage::testOptionalJSObjects): 2009-09-02 Richard Moore <rich@kde.org> Reviewed by Tor Arne Vestbø. [Qt] Make sure we relayout the page after evaluating JS https://bugs.webkit.org/show_bug.cgi?id=28235 QtWebKit does not always seem to reflow the page when evaluating javascript. This patch changes the way evaluateJavaScript works to use the frameloader which ensures that this is done properly. * Api/qwebframe.cpp: (QWebFrame::evaluateJavaScript): * tests/qwebframe/tst_qwebframe.cpp: 2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> Reviewed by Holger Freyther. https://bugs.webkit.org/show_bug.cgi?id=25889 [GTK] scrollbar policy for main frame is not implementable Add empty implementation for new ChromeClient method. * WebCoreSupport/ChromeClientQt.h: (WebCore::ChromeClientQt::scrollbarsModeDidChange): 2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Ariya Hidayat. QWebHistory::clear() modifications. Clear() method was changed. If QWebHistory is empty (there is no elements even current) clear() do nothing. If there at least one element clear() will delete everything apart of current. New autotests in QWebHistory New autotests were added to QWebHistory. They should check some crashes in save and restore state process and clear() method and general behavior on where QWebHistory::count() == 0 or QWebHistory::count() == 1 Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=28711 * Api/qwebhistory.cpp: (QWebHistory::clear): * tests/qwebhistory/tst_qwebhistory.cpp: (tst_QWebHistory::back): (tst_QWebHistory::forward): (tst_QWebHistory::saveAndRestore_crash_1): (tst_QWebHistory::saveAndRestore_crash_2): (tst_QWebHistory::saveAndRestore_crash_3): (tst_QWebHistory::clear): 2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Ariya Hidayat. [Qt] Cleanup, old and commented part of source code was removed. Fix some formatting problems. https://bugs.webkit.org/show_bug.cgi?id=28712 * Api/qwebhistory_p.h: (QWebHistoryPrivate::QWebHistoryPrivate): 2009-08-26 Adam Barth <abarth@webkit.org> Reviewed by Oliver Hunt. Don't let local files access web URLs https://bugs.webkit.org/show_bug.cgi?id=28480 * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-08-25 Antonio Gomes <antonio.gomes@openbossa.org> Reviewed by Ariya Hidayat. Bug 28708 - Make possible to better use ResourceError in FrameLoaderClientQt class. * Api/qwebframe.cpp: (QWebFrame::requestedUrl): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad): (WebCore::FrameLoaderClientQt::postProgressFinishedNotification): (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): * WebCoreSupport/FrameLoaderClientQt.h: 2009-08-22 Adam Barth <abarth@webkit.org> Revert 47684. We're going to do this later once clients have had a chance to opt into the setting they like. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-08-22 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Don't let local files access web URLs https://bugs.webkit.org/show_bug.cgi?id=28480 * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-08-19 Aaron Boodman <aa@chromium.org> Speculative build break fix for qt. * Api/qwebsecurityorigin.cpp: (QWebSecurityOrigin::whiteListAccessFromOrigin): * Api/qwebsecurityorigin.h: 2009-08-19 Aaron Boodman <aa@chromium.org> Reviewed by David Levin. https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to specify a more granular policy for cross-origin XHR access. * Api/qwebsecurityorigin.cpp: Add API to manipulate origin access whitelists. (QWebSecurityOrigin::whiteListAccessFromOrigin): Ditto. (QWebSecurityOrigin::resetOriginAccessWhiteLists): Ditto. * Api/qwebsecurityorigin.h: Ditto. 2009-08-18 Markus Goetz <Markus.Goetz@nokia.com> Reviwed by Ariya Hidayat. [Qt] For prefecthDNS, the pre-fetching has to be enabled in the WebSettings. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): * Api/qwebsettings.h: 2009-08-17 Darin Adler <darin@apple.com> Try to fix Qt build again. * WebCoreSupport/EditorClientQt.cpp: Move "using namespace". 2009-08-17 Darin Adler <darin@apple.com> Try to fix Qt build. * WebCoreSupport/EditorClientQt.cpp: (WebCore::EditorClientQt::shouldShowDeleteInterface): Use getAttribute(classAttr) instead of className() function. 2009-08-14 Yongjun Zhang <yongjun.zhang@nokia.com> Reviewed by Simon Hausmann. RVCT elftran fails to resolve QPainter::staticMetaObject coming with QWebView::RenderHints property. This is a temporary fix and will be revereted when the right symbols exported from Qt lib in S60. https://bugs.webkit.org/show_bug.cgi?id=28181 * Api/qwebview.h: 2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Simon Hausmann. [Qt] Public API to configure the storage path for HTML5 localStorage https://bugs.webkit.org/show_bug.cgi?id=28036 Disables LocalStorage for QtWebKit by default by setting QWebSettings::LocalStorageEnabled to false. Sets up a default for the LocalStorage path so that clients would only need to enable the LocalStorageEnabled setting to turn on LocalStoragre support. Turn on LocalStorage support for QtLauncher and the relevant test since LocalStorage is now disabled by default for QtWebkit. * Api/qwebpage.cpp: (defaultCachePath): (initializeApplicationCachePathIfNecessary): (QWebPagePrivate::QWebPagePrivate): * Api/qwebsettings.cpp: (QWebSettingsPrivate::apply): (QWebSettings::QWebSettings): (QWebSettings::setLocalStoragePath): (QWebSettings::localStoragePath): * Api/qwebsettings.h: * QtLauncher/main.cpp: (main): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::multiplePageGroupsAndLocalStorage): 2009-08-14 Yael Aharon <yael.aharon@nokia.com> Reviewed by Simon Hausmann. [Qt] Allow applications to register their own local URL scheme. https://bugs.webkit.org/show_bug.cgi?id=28240 * Api/qwebsecurityorigin.cpp: (QWebSecurityOrigin::addLocalScheme): (QWebSecurityOrigin::removeLocalScheme): (QWebSecurityOrigin::localSchemes): * Api/qwebsecurityorigin.h: * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::localURLSchemes): 2009-08-13 Mark Rowe <mrowe@apple.com> Try and fix the Qt build. * Api/qwebelement.cpp: 2009-08-13 Kavindra Devi Palaraja <kavindra.palaraja@nokia.com> Reviewed by Simon Hausmann. Doc - Some cleanup on the documentation of QWebElement * Api/qwebelement.cpp: 2009-08-13 Norbert Leser <norbert.leser@nokia.com> Reviewed by Simon Hausmann. Symbian target components (library and executable files) require Unique Identifiers (i.e., UID3). These identifiers are defined in the respective project files, conditionally for "symbian" platform. * QtLauncher/QtLauncher.pro: * tests/qwebelement/qwebelement.pro: * tests/qwebframe/qwebframe.pro: * tests/qwebhistory/qwebhistory.pro: * tests/qwebhistoryinterface/qwebhistoryinterface.pro: * tests/qwebpage/qwebpage.pro: * tests/qwebview/qwebview.pro: 2009-08-12 George Wright <george.wright@torchmobile.com> Reviewed by Adam Treat. Initialise zoom levels independent of whether a URL is valid or not to fix https://bugs.webkit.org/show_bug.cgi?id=28162 * QtLauncher/main.cpp: (MainWindow::MainWindow): 2009-08-12 Joerg Bornemann <joerg.bornemann@trolltech.com> Reviewed by Simon Hausmann. QtWebKit compile fix for Windows CE There's no getenv on Windows CE, use qgetenv instead. * Api/qwebpage.cpp: (qt_drt_overwritePluginDirectories): 2009-08-10 Kavindra Palaraja <kavindra.palaraja@nokia.com> Reviewed by Simon Hausmann. Various fixes and improvements to the QWebPluginInfo, QWebPluginDatabase and QWebSettings documentation. * Api/qwebplugindatabase.cpp: * Api/qwebsettings.cpp: 2009-08-08 Volker Hilsheimer <volker.hilsheimer@nokia.com> Reviewed by Simon Hausmann. Doc: there is no group of explicitly shared classes, only one class uses this. Explain the implications in the QWebHistoryItem documentation, and get rid of the "group". * Api/qwebhistory.cpp: 2009-08-05 Csaba Osztrogonac <oszi@inf.u-szeged.hu> Reviewed by Simon Hausmann. [Qt] Fix build error caused by http://trac.webkit.org/changeset/46763 * Api/qwebpluginfactory.h: Export macro added. 2009-08-04 Antonio Gomes <antonio.gomes@openbossa.org> Reviewed by Simon Hausmann. [Qt] QWebFrame::requestedUrl method can mis-behave in case of unhandled sslErrors. https://bugs.webkit.org/show_bug.cgi?id=27804 * Api/qwebframe.cpp: (QWebFrame::requestedUrl): * tests/qwebframe/tst_qwebframe.cpp: 2009-08-04 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Tor Arne Vestbø. Rename QWebPlugin to QWebPluginInfo, as discussed on IRC. * Api/qwebplugindatabase.cpp: (QWebPluginInfoPrivate::QWebPluginInfoPrivate): (QWebPluginInfo::QWebPluginInfo): (QWebPluginInfo::~QWebPluginInfo): (QWebPluginInfo::name): (QWebPluginInfo::description): (QWebPluginInfo::mimeTypes): (QWebPluginInfo::supportsMimeType): (QWebPluginInfo::path): (QWebPluginInfo::isNull): (QWebPluginInfo::setEnabled): (QWebPluginInfo::isEnabled): (QWebPluginInfo::operator==): (QWebPluginInfo::operator!=): (QWebPluginInfo::operator=): (QWebPluginDatabase::plugins): (QWebPluginDatabase::pluginForMimeType): (QWebPluginDatabase::setPreferredPluginForMimeType): * Api/qwebplugindatabase.h: * Api/qwebplugindatabase_p.h: * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: (tst_QWebPluginDatabase::installedPlugins): (tst_QWebPluginDatabase::searchPaths): (tst_QWebPluginDatabase::null_data): (tst_QWebPluginDatabase::null): (tst_QWebPluginDatabase::pluginForMimeType): (tst_QWebPluginDatabase::enabled): (tst_QWebPluginDatabase::operatorequal_data): (tst_QWebPluginDatabase::operatorequal): (tst_QWebPluginDatabase::preferredPlugin): 2009-08-04 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Adam Treat. Replace QWebPlugin::MimeType with a typedef to QWebPluginFactory::MimeType. * Api/qwebplugindatabase.cpp: * Api/qwebplugindatabase.h: * Api/qwebpluginfactory.cpp: (QWebPluginFactory::MimeType::operator==): * Api/qwebpluginfactory.h: 2009-08-04 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. Add QWebPluginDatabase API to the Qt API. https://bugs.webkit.org/show_bug.cgi?id=27651 * Api/headers.pri: * Api/qwebplugindatabase.cpp: Added. (QWebPluginPrivate::QWebPluginPrivate): (QWebPluginDatabasePrivate::QWebPluginDatabasePrivate): (QWebPlugin::MimeType::operator==): (QWebPlugin::QWebPlugin): (QWebPlugin::~QWebPlugin): (QWebPlugin::name): (QWebPlugin::description): (QWebPlugin::mimeTypes): (QWebPlugin::supportsMimeType): (QWebPlugin::path): (QWebPlugin::isNull): (QWebPlugin::setEnabled): (QWebPlugin::isEnabled): (QWebPlugin::operator==): (QWebPlugin::operator!=): (QWebPlugin::operator=): (QWebPluginDatabase::QWebPluginDatabase): (QWebPluginDatabase::~QWebPluginDatabase): (QWebPluginDatabase::plugins): (QWebPluginDatabase::defaultSearchPaths): (QWebPluginDatabase::searchPaths): (QWebPluginDatabase::setSearchPaths): (QWebPluginDatabase::addSearchPath): (QWebPluginDatabase::refresh): (QWebPluginDatabase::pluginForMimeType): (QWebPluginDatabase::setPreferredPluginForMimeType): * Api/qwebplugindatabase.h: Added. * Api/qwebplugindatabase_p.h: Added. * Api/qwebsettings.cpp: (QWebSettings::pluginDatabase): * Api/qwebsettings.h: * tests/qwebplugindatabase/qwebplugindatabase.pro: Added. * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: Added. (tst_QWebPluginDatabase::installedPlugins): (tst_QWebPluginDatabase::searchPaths): (tst_QWebPluginDatabase::null_data): (tst_QWebPluginDatabase::null): (tst_QWebPluginDatabase::pluginForMimeType): (tst_QWebPluginDatabase::enabled): (tst_QWebPluginDatabase::operatorequal_data): (tst_QWebPluginDatabase::operatorequal): (tst_QWebPluginDatabase::preferredPlugin): * tests/tests.pro: 2009-08-03 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> Reviewed by Simon Hausmann. Do memory cleanup when running robotized QtLauncher in debug as well. * QtLauncher/main.cpp: (launcherMain): (main): 2009-07-30 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Tor Arne Vestbø. [Qt] Initialize HTML5 Application Cache for QtWebKit to a sensible default https://bugs.webkit.org/show_bug.cgi?id=27866 * Api/qwebpage.cpp: (initializeApplicationCachePathIfNecessary): (QWebPagePrivate::QWebPagePrivate): 2009-07-31 Jakob Petsovits <jakob.petsovits@torchmobile.com> Reviewed by Adam Treat. Build QtWebKit without benchmark tests for Qt < 4.5. https://bugs.webkit.org/show_bug.cgi?id=27886 The QBENCHMARK macro is only available from 4.5 on, so builds for Qt < 4.5 shouldn't try to build those. * tests/tests.pro: 2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Adam Treat. Fix warning by migrating use of QString.sprintf(...) to QString.arg().arg()... * WebCoreSupport/EditorClientQt.cpp: (dumpRange): 2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Tor Arne Vestbø. Expose the Offline Web Application Cache in the Qt API. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): (QWebSettings::setOfflineWebApplicationCachePath): (QWebSettings::offlineWebApplicationCachePath): (QWebSettings::setOfflineWebApplicationCacheQuota): (QWebSettings::offlineWebApplicationCacheQuota): * Api/qwebsettings.h: 2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Adam Treat. Add missing Q_OBJECT to class inheriting from QObject. * tests/qwebframe/tst_qwebframe.cpp: 2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Adam Treat. Fix indentation. * tests/qwebframe/tst_qwebframe.cpp: 2009-07-30 Volker Hilsheimer <volker.hilsheimer@nokia.com> Reviewed by Simon Hausmann. Fix documentation links to examples. * Api/qwebview.cpp: 2009-07-30 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> Reviewed by Simon Hausmann. Allocate MainWindow on heap in robotized QtLauncher as well. * QtLauncher/main.cpp: (main): 2009-07-29 Kevin McCullough <kmccullough@apple.com> Reviewed by Darin Adler. Added foundation work to allow a testing infrastructure for the Web Inspector. * WebCoreSupport/InspectorClientQt.cpp: (WebCore::InspectorClientQt::inspectorWindowObjectCleared): * WebCoreSupport/InspectorClientQt.h: 2009-07-29 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> Reviewed by Simon Hausmann. [Qt] In debug mode, this fix frees cached resources and other unreferenced objects (by calling the garbage collector) to remove the LEAK messages. https://bugs.webkit.org/show_bug.cgi?id=27767 * Api/qwebframe.cpp: (qt_drt_cache_clear): * QtLauncher/main.cpp: (main): 2009-07-28 Kenneth Rohde Christiansen <kenneth@webkit.org> Fix the Qt build by adapting to the changes of ScriptObject. * Api/qwebelement.cpp: (setupScriptObject): 2009-07-28 Robert Hogan <robert@roberthogan.net> Reviewed by Simon Hausmann. Add WebKit version API to Qt. Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig at compile time and make it available to Qt applications through qWebKitVersion(). Also amend the User Agent string to place the Safari clause outside the final bracket and to the end of the UA string. https://bugs.webkit.org/show_bug.cgi?id=27158 Minor build tweak by Simon Hausmann (adding export macros to new functions). * Api/headers.pri: * Api/qwebkitversion.cpp: Added. (webKitVersion): (webKitMajorVersion): (webKitMinorVersion): * Api/qwebkitversion.h: Added. * Api/qwebpage.cpp: (QWebPage::userAgentForUrl): * tests/qwebview/tst_qwebview.cpp: (tst_QWebView::getWebKitVersion): http://qt.nokia.com/developer/task-tracker/index_html?id=238391&method=entry http://qt.nokia.com/developer/task-tracker/index_html?id=219344&method=entry http://qt.nokia.com/developer/task-tracker/index_html?id=241144&method=entry
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/tests')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp163
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp67
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp90
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp437
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pro4
13 files changed, 741 insertions, 45 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
index dd0b88a..ea2bc79 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qwebelement.cpp
RESOURCES += qwebelement.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C3
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
index e45e6dc..a3e099b 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qwebframe.cpp
RESOURCES += qwebframe.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C6
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index a3bcd20..561087f 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -33,6 +33,8 @@
#include <QRegExp>
#include <QNetworkRequest>
#include <QNetworkReply>
+#include <qsslerror.h>
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -576,6 +578,9 @@ private slots:
void urlChange();
void domCycles();
void requestedUrl();
+ void javaScriptWindowObjectCleared_data();
+ void javaScriptWindowObjectCleared();
+ void javaScriptWindowObjectClearedOnEvaluate();
void setHtml();
void setHtmlWithResource();
void ipv6HostEncoding();
@@ -590,6 +595,7 @@ private slots:
void hasSetFocus();
void render();
void scrollPosition();
+ void evaluateWillCauseRepaint();
private:
QString evalJS(const QString&s) {
@@ -2167,56 +2173,70 @@ void tst_QWebFrame::domCycles()
class FakeReply : public QNetworkReply {
Q_OBJECT
- public:
- FakeReply(const QNetworkRequest& request, QObject* parent = 0)
- : QNetworkReply(parent)
- {
- setOperation(QNetworkAccessManager::GetOperation);
- setRequest(request);
- if (request.url() == QUrl("qrc:/test1.html")) {
- setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
- setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
- } else
- setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
-
- open(QIODevice::ReadOnly);
- QTimer::singleShot(0, this, SLOT(timeout()));
- }
- ~FakeReply()
- {
- close();
- }
- virtual void abort() {}
- virtual void close() {}
- protected:
- qint64 readData(char*, qint64)
- {
- return 0;
- }
- private slots:
- void timeout()
- {
- if (request().url() == QUrl("qrc://test1.html"))
- emit error(this->error());
- else if (request().url() == QUrl("http://abcdef.abcdef/"))
- emit metaDataChanged();
+public:
+ FakeReply(const QNetworkRequest& request, QObject* parent = 0)
+ : QNetworkReply(parent)
+ {
+ setOperation(QNetworkAccessManager::GetOperation);
+ setRequest(request);
+ if (request.url() == QUrl("qrc:/test1.html")) {
+ setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
+ setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
+ } else if (request.url() == QUrl("qrc:/fake-ssl-error.html"))
+ setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error !")); // force a ssl error
+ else if (request.url() == QUrl("http://abcdef.abcdef/"))
+ setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
- emit readyRead();
- emit finished();
- }
+ open(QIODevice::ReadOnly);
+ QTimer::singleShot(0, this, SLOT(timeout()));
+ }
+ ~FakeReply()
+ {
+ close();
+ }
+ virtual void abort() {}
+ virtual void close() {}
+
+protected:
+ qint64 readData(char*, qint64)
+ {
+ return 0;
+ }
+
+private slots:
+ void timeout()
+ {
+ if (request().url() == QUrl("qrc://test1.html"))
+ emit error(this->error());
+ else if (request().url() == QUrl("http://abcdef.abcdef/"))
+ emit metaDataChanged();
+ else if (request().url() == QUrl("qrc:/fake-ssl-error.html"))
+ return;
+
+ emit readyRead();
+ emit finished();
+ }
};
class FakeNetworkManager : public QNetworkAccessManager {
+ Q_OBJECT
+
public:
FakeNetworkManager(QObject* parent) : QNetworkAccessManager(parent) { }
protected:
virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
{
- if (op == QNetworkAccessManager::GetOperation
- && (request.url().toString() == "qrc:/test1.html"
- || request.url().toString() == "http://abcdef.abcdef/"))
- return new FakeReply(request, this);
+ QString url = request.url().toString();
+ if (op == QNetworkAccessManager::GetOperation)
+ if (url == "qrc:/test1.html" || url == "http://abcdef.abcdef/")
+ return new FakeReply(request, this);
+ else if (url == "qrc:/fake-ssl-error.html") {
+ FakeReply* reply = new FakeReply(request, this);
+ QList<QSslError> errors;
+ emit sslErrors(reply, errors << QSslError(QSslError::UnspecifiedError));
+ return reply;
+ }
return QNetworkAccessManager::createRequest(op, request, outgoingData);
}
@@ -2249,6 +2269,50 @@ void tst_QWebFrame::requestedUrl()
QCOMPARE(spy.count(), 3);
QCOMPARE(frame->requestedUrl(), QUrl("http://abcdef.abcdef/"));
QCOMPARE(frame->url(), QUrl("http://abcdef.abcdef/"));
+
+ qRegisterMetaType<QList<QSslError> >("QList<QSslError>");
+ qRegisterMetaType<QNetworkReply* >("QNetworkReply*");
+
+ QSignalSpy spy2(page.networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)));
+ frame->setUrl(QUrl("qrc:/fake-ssl-error.html"));
+ QTest::qWait(200);
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(frame->requestedUrl(), QUrl("qrc:/fake-ssl-error.html"));
+ QCOMPARE(frame->url(), QUrl("qrc:/fake-ssl-error.html"));
+}
+
+void tst_QWebFrame::javaScriptWindowObjectCleared_data()
+{
+ QTest::addColumn<QString>("html");
+ QTest::addColumn<int>("signalCount");
+ QTest::newRow("with <script>") << "<html><body><script></script><p>hello world</p></body></html>" << 1;
+ QTest::newRow("without <script>") << "<html><body><p>hello world</p></body></html>" << 0;
+}
+
+void tst_QWebFrame::javaScriptWindowObjectCleared()
+{
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared()));
+ QFETCH(QString, html);
+ frame->setHtml(html);
+
+ QFETCH(int, signalCount);
+ QCOMPARE(spy.count(), signalCount);
+}
+
+void tst_QWebFrame::javaScriptWindowObjectClearedOnEvaluate()
+{
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared()));
+ frame->setHtml("<html></html>");
+ QCOMPARE(spy.count(), 0);
+ frame->evaluateJavaScript("var a = 'a';");
+ QCOMPARE(spy.count(), 1);
+ // no new clear for a new script:
+ frame->evaluateJavaScript("var a = 1;");
+ QCOMPARE(spy.count(), 1);
}
void tst_QWebFrame::setHtml()
@@ -2643,5 +2707,24 @@ void tst_QWebFrame::scrollPosition()
QCOMPARE(y, 29);
}
+void tst_QWebFrame::evaluateWillCauseRepaint()
+{
+ QWebView view;
+ QString html("<html><body>top<div id=\"junk\" style=\"display: block;\">"
+ "junk</div>bottom</body></html>");
+ view.setHtml(html);
+ view.show();
+
+ QTest::qWait(200);
+
+ view.page()->mainFrame()->evaluateJavaScript(
+ "document.getElementById('junk').style.display = 'none';");
+
+ ::waitForSignal(view.page(), SIGNAL(repaintRequested( const QRect &)));
+
+ QTest::qWait(2000);
+}
+
+
QTEST_MAIN(tst_QWebFrame)
#include "tst_qwebframe.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
index fd1074c..55ed414 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qwebhistory.cpp
RESOURCES += tst_qwebhistory.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C4
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index 5b55613..ec7a040 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -58,6 +58,11 @@ private slots:
void saveAndRestore_1(); //simple checks saveState and restoreState
void saveAndRestore_2(); //bad parameters saveState and restoreState
void saveAndRestore_3(); //try use different version
+ void saveAndRestore_crash_1();
+ void saveAndRestore_crash_2();
+ void saveAndRestore_crash_3();
+ void clear();
+
private:
QWebPage* page;
@@ -119,6 +124,8 @@ void tst_QWebHistory::back()
hist->back();
waitForLoadFinished.exec();
}
+ //try one more time (too many). crash test
+ hist->back();
}
/**
@@ -137,6 +144,8 @@ void tst_QWebHistory::forward()
hist->forward();
waitForLoadFinished.exec();
}
+ //try one more time (too many). crash test
+ hist->forward();
}
/**
@@ -322,5 +331,63 @@ void tst_QWebHistory::saveAndRestore_3()
QVERIFY(hist->itemAt(3).isValid());
}
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_1()
+{
+ QByteArray tmp = hist->saveState();
+ for (unsigned i = 0; i < 5; i++){
+ hist->restoreState(tmp);
+ hist->saveState();
+ }
+}
+
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_2()
+{
+ QByteArray tmp = hist->saveState();
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist2 = page2->history();
+ for (unsigned i = 0; i < 5; i++){
+ hist2->restoreState(tmp);
+ hist2->saveState();
+ }
+ delete page2;
+}
+
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_3()
+{
+ QByteArray tmp = hist->saveState();
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist1 = hist;
+ QWebHistory* hist2 = page2->history();
+ for (unsigned i = 0; i < 5; i++){
+ hist1->restoreState(tmp);
+ hist2->restoreState(tmp);
+ QVERIFY(hist1->count() == hist2->count());
+ QVERIFY(hist1->count() == histsize);
+ hist2->back();
+ tmp = hist2->saveState();
+ hist2->clear();
+ }
+ delete page2;
+}
+
+/** ::clear */
+void tst_QWebHistory::clear()
+{
+ hist->saveState();
+ QVERIFY(hist->count() > 1);
+ hist->clear();
+ QVERIFY(hist->count() == 1); //leave current item
+
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist2 = page2->history();
+ QVERIFY(hist2->count() == 0);
+ hist2->clear();
+ QVERIFY(hist2->count() == 0); //do not change anything
+ delete page2;
+}
+
QTEST_MAIN(tst_QWebHistory)
#include "tst_qwebhistory.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
index af3b348..011869d 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -4,3 +4,5 @@ include(../../../../WebKit.pri)
SOURCES += tst_qwebhistoryinterface.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C5
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
index 2f3a108..e4b11c2 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qwebpage.cpp
RESOURCES += tst_qwebpage.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C7
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 966f049..121d7cb 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -110,6 +110,9 @@ private slots:
void frameAt();
void requestCache();
void protectBindingsRuntimeObjectsFromCollector();
+ void localURLSchemes();
+ void testOptionalJSObjects();
+ void testEnablePersistentStorage();
private:
@@ -405,6 +408,10 @@ void tst_QWebPage::database()
QWebSettings::setOfflineStorageDefaultQuota(1024 * 1024);
QVERIFY(QWebSettings::offlineStorageDefaultQuota() == 1024 * 1024);
+ m_page->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ m_page->settings()->setAttribute(QWebSettings::SessionStorageEnabled, true);
+ m_page->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
+
QString dbFileName = path + "Databases.db";
if (QFile::exists(dbFileName))
@@ -627,7 +634,6 @@ void tst_QWebPage::createViewlessPlugin()
// import private API
void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName);
QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page);
-void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path);
void tst_QWebPage::multiplePageGroupsAndLocalStorage()
{
@@ -638,9 +644,11 @@ void tst_QWebPage::multiplePageGroupsAndLocalStorage()
QWebView view1;
QWebView view2;
- qt_websettings_setLocalStorageDatabasePath(view1.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
+ view1.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ view1.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
qt_webpage_setGroupName(view1.page(), "group1");
- qt_websettings_setLocalStorageDatabasePath(view2.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
+ view2.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ view2.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
qt_webpage_setGroupName(view2.page(), "group2");
QCOMPARE(qt_webpage_groupName(view1.page()), QString("group1"));
QCOMPARE(qt_webpage_groupName(view2.page()), QString("group2"));
@@ -1190,5 +1198,81 @@ void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector()
newPage->mainFrame()->evaluateJavaScript("testme('bar')");
}
+void tst_QWebPage::localURLSchemes()
+{
+ int i = QWebSecurityOrigin::localSchemes().size();
+ QWebSecurityOrigin::removeLocalScheme("file");
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QWebSecurityOrigin::addLocalScheme("file");
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QString myscheme = "myscheme";
+ QWebSecurityOrigin::addLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i + 1);
+ QVERIFY(QWebSecurityOrigin::localSchemes().contains(myscheme));
+ QWebSecurityOrigin::removeLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QWebSecurityOrigin::removeLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+}
+
+static inline bool testFlag(QWebPage& webPage, QWebSettings::WebAttribute settingAttribute, const QString& jsObjectName, bool settingValue)
+{
+ webPage.settings()->setAttribute(settingAttribute, settingValue);
+ return webPage.mainFrame()->evaluateJavaScript(QString("(window.%1 != undefined)").arg(jsObjectName)).toBool();
+}
+
+void tst_QWebPage::testOptionalJSObjects()
+{
+ // Once a feature is enabled and the JS object is accessed turning off the setting will not turn off
+ // the visibility of the JS object any more. For this reason this test uses two QWebPage instances.
+ // Part of the test is to make sure that the QWebPage instances do not interfere with each other so turning on
+ // a feature for one instance will not turn it on for another.
+
+ QWebPage webPage1;
+ QWebPage webPage2;
+
+ webPage1.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl());
+ webPage2.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl());
+
+ QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", true), true);
+ QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), true);
+
+ QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", true), true);
+ QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", false), true);
+
+ QCOMPARE(testFlag(webPage1, QWebSettings::SessionStorageEnabled, "sessionStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::SessionStorageEnabled, "sessionStorage", true), true);
+ QCOMPARE(testFlag(webPage1, QWebSettings::SessionStorageEnabled, "sessionStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::SessionStorageEnabled, "sessionStorage", false), true);
+}
+
+void tst_QWebPage::testEnablePersistentStorage()
+{
+ QWebPage webPage;
+
+ // By default all persistent options should be disabled
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), false);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), false);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), false);
+ QVERIFY(webPage.settings()->iconDatabasePath().isEmpty());
+
+ QWebSettings::enablePersistentStorage();
+
+ // Give it some time to initialize - icon database needs it
+ QTest::qWait(1000);
+
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true);
+
+ QVERIFY(!webPage.settings()->offlineStoragePath().isEmpty());
+ QVERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty());
+ QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty());
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
new file mode 100644
index 0000000..5d10993
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = tst_qwebplugindatabase
+include(../../../../WebKit.pri)
+SOURCES += tst_qwebplugindatabase.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
new file mode 100644
index 0000000..1ee6206
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
@@ -0,0 +1,437 @@
+/*
+ Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <QtTest/QtTest>
+
+#include <qdir.h>
+#include <qwebframe.h>
+#include <qwebpage.h>
+#include <qwebplugindatabase.h>
+#include <qwebsettings.h>
+#include <qvariant.h>
+
+class tst_QWebPluginDatabase : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void installedPlugins();
+ void searchPaths();
+ void null_data();
+ void null();
+ void pluginForMimeType();
+ void enabled();
+ void operatorequal_data();
+ void operatorequal();
+ void preferredPlugin();
+ void operatorassign_data();
+ void operatorassign();
+};
+
+typedef QWebPluginInfo::MimeType MimeType;
+
+void tst_QWebPluginDatabase::installedPlugins()
+{
+ QWebPage page;
+ page.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ QWebFrame* frame = page.mainFrame();
+
+ QVariantMap jsPluginsMap = frame->evaluateJavaScript("window.navigator.plugins").toMap();
+ QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins();
+ QCOMPARE(plugins, QWebSettings::pluginDatabase()->plugins());
+
+ int length = jsPluginsMap["length"].toInt();
+ QCOMPARE(length, plugins.count());
+
+ for (int i = 0; i < length; ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QVariantMap jsPlugin = frame->evaluateJavaScript(QString("window.navigator.plugins[%1]").arg(i)).toMap();
+ QString name = jsPlugin["name"].toString();
+ QString description = jsPlugin["description"].toString();
+ QString fileName = jsPlugin["filename"].toString();
+
+ QCOMPARE(plugin.name(), name);
+ QCOMPARE(plugin.description(), description);
+ QCOMPARE(QFileInfo(plugin.path()).fileName(), fileName);
+
+ QList<MimeType> mimeTypes;
+ int mimeTypesCount = jsPlugin["length"].toInt();
+
+ for (int j = 0; j < mimeTypesCount; ++j) {
+ QVariantMap jsMimeType = frame->evaluateJavaScript(QString("window.navigator.plugins[%1][%2]").arg(i).arg(j)).toMap();
+
+ MimeType mimeType;
+ mimeType.name = jsMimeType["type"].toString();
+ mimeType.description = jsMimeType["description"].toString();
+ mimeType.fileExtensions = jsMimeType["suffixes"].toString().split(',', QString::SkipEmptyParts);
+
+ mimeTypes.append(mimeType);
+ QVERIFY(plugin.supportsMimeType(mimeType.name));
+ }
+
+ QCOMPARE(plugin.mimeTypes(), mimeTypes);
+
+ QVERIFY(!plugin.isNull());
+ QVERIFY(plugin.isEnabled());
+ }
+}
+
+void tst_QWebPluginDatabase::searchPaths()
+{
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+ QStringList directories = database->searchPaths();
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+
+ database->setSearchPaths(directories);
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), directories);
+ QCOMPARE(database->plugins(), plugins);
+ database->refresh();
+ QCOMPARE(database->plugins(), plugins);
+
+ database->setSearchPaths(QStringList());
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), QStringList());
+ QCOMPARE(database->plugins().count(), 0);
+
+ database->setSearchPaths(directories);
+ QCOMPARE(database->searchPaths(), directories);
+ database->addSearchPath(QDir::tempPath());
+ QCOMPARE(database->searchPaths().count(), directories.count() + 1);
+ QVERIFY(database->searchPaths().contains(QDir::tempPath()));
+ directories.append(QDir::tempPath());
+ QCOMPARE(database->searchPaths(), directories);
+
+ // As an empty set of search paths has been set, the database has been rebuilt
+ // from scratch after bringing the old path set back.
+ // Because the QWebPlugins no longer point to the same PluginPackages,
+ // the list is also no longer equal to the older one, even though it contains
+ // the same information.
+ QCOMPARE(database->plugins().count(), plugins.count());
+ plugins = database->plugins();
+ QCOMPARE(database->plugins(), plugins);
+
+ for (int i = (directories.count() - 1); i >= 0; --i) {
+ QDir directory(directories.at(i));
+ if (!directory.exists() || !directory.count())
+ directories.removeAt(i);
+ }
+
+ database->setSearchPaths(directories);
+ QCOMPARE(database->plugins(), plugins);
+ database->refresh();
+ QCOMPARE(database->plugins(), plugins);
+
+ database->setSearchPaths(QWebPluginDatabase::defaultSearchPaths());
+ directories = QWebPluginDatabase::defaultSearchPaths();
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), directories);
+ QCOMPARE(database->plugins(), plugins);
+}
+
+Q_DECLARE_METATYPE(QWebPluginInfo)
+void tst_QWebPluginDatabase::null_data()
+{
+ QTest::addColumn<QWebPluginInfo>("plugin");
+ QTest::addColumn<bool>("null");
+
+ QTest::newRow("null") << QWebPluginInfo() << true;
+ QTest::newRow("foo") << QWebSettings::pluginDatabase()->pluginForMimeType("foobarbaz") << true;
+
+ QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins();
+ for (int i = 0; i < plugins.count(); ++i)
+ QTest::newRow(QString::number(i).toUtf8().constData()) << plugins.at(i) << false;
+}
+
+void tst_QWebPluginDatabase::null()
+{
+ QFETCH(QWebPluginInfo, plugin);
+ QFETCH(bool, null);
+
+ QCOMPARE(plugin.isNull(), null);
+}
+
+void tst_QWebPluginDatabase::pluginForMimeType()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ }
+ }
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+
+ QVERIFY(pluginsMap.count(mimeType) > 0);
+ if (pluginsMap.count(mimeType) > 1)
+ continue;
+
+ QWebPluginInfo pluginForMimeType = database->pluginForMimeType(mimeType);
+ QCOMPARE(pluginForMimeType, plugin);
+ database->setSearchPaths(database->searchPaths());
+ QCOMPARE(pluginForMimeType, plugin);
+ QCOMPARE(pluginForMimeType, database->pluginForMimeType(mimeType.toUpper()));
+ QCOMPARE(pluginForMimeType, database->pluginForMimeType(mimeType.toLower()));
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ QVERIFY(!pluginForMimeType.isNull());
+ QVERIFY(!plugin.isNull());
+ }
+ }
+}
+
+void tst_QWebPluginDatabase::enabled()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ }
+ }
+
+ QMultiMap<QString, QWebPluginInfo>::iterator it = pluginsMap.begin();
+ while (it != pluginsMap.end()) {
+ QString mimeType = it.key();
+ QWebPluginInfo plugin = it.value();
+ QWebPluginInfo pluginForMimeType = database->pluginForMimeType(mimeType);
+
+ QVERIFY(pluginsMap.count(mimeType) > 0);
+
+ if (pluginsMap.count(mimeType) == 1) {
+ QCOMPARE(plugin, pluginForMimeType);
+
+ QVERIFY(plugin.isEnabled());
+ QVERIFY(pluginForMimeType.isEnabled());
+ plugin.setEnabled(false);
+ QVERIFY(!plugin.isEnabled());
+ QVERIFY(!pluginForMimeType.isEnabled());
+ } else {
+ QVERIFY(plugin.isEnabled());
+ QVERIFY(pluginForMimeType.isEnabled());
+ plugin.setEnabled(false);
+ QVERIFY(!plugin.isEnabled());
+ }
+
+ QVERIFY(!plugin.isNull());
+ QVERIFY(!pluginForMimeType.isNull());
+
+ QWebPluginInfo pluginForMimeType2 = database->pluginForMimeType(mimeType);
+ if (pluginsMap.count(mimeType) == 1) {
+ QVERIFY(pluginForMimeType2 != plugin);
+ QVERIFY(pluginForMimeType2.isNull());
+ } else {
+ QVERIFY(pluginForMimeType2 != plugin);
+ QVERIFY(!pluginForMimeType2.isNull());
+ }
+
+ plugin.setEnabled(true);
+
+ ++it;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorequal_data()
+{
+ QTest::addColumn<QWebPluginInfo>("first");
+ QTest::addColumn<QWebPluginInfo>("second");
+ QTest::addColumn<bool>("equal");
+
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QTest::newRow("null") << QWebPluginInfo() << QWebPluginInfo() << true;
+ QTest::newRow("application/x-shockwave-flash") << database->pluginForMimeType("application/x-shockwave-flash")
+ << database->pluginForMimeType("application/x-shockwave-flash") << true;
+ QTest::newRow("foo/bar-baz") << database->pluginForMimeType("foo/bar-baz")
+ << database->pluginForMimeType("foo/bar-baz") << true;
+
+ QList<QWebPluginInfo> plugins = database->plugins();
+ for (int i = 0; i < (plugins.count() - 1); ++i) {
+ QWebPluginInfo first = plugins.at(i);
+ QWebPluginInfo second = plugins.at(i + 1);
+
+ QTest::newRow(QString("%1==%2").arg(first.name(), second.name()).toUtf8().constData())
+ << first << second << false;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorequal()
+{
+ QFETCH(QWebPluginInfo, first);
+ QFETCH(QWebPluginInfo, second);
+ QFETCH(bool, equal);
+
+ QCOMPARE(first == second, equal);
+}
+
+void tst_QWebPluginDatabase::preferredPlugin()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ }
+ }
+
+ QMultiMap<QString, QWebPluginInfo>::iterator it = pluginsMap.begin();
+ while (it != pluginsMap.end()) {
+ QString mimeType = it.key();
+
+ if (pluginsMap.count(mimeType) > 1) {
+ QList<QWebPluginInfo> pluginsForMimeType = pluginsMap.values(mimeType);
+ QWebPluginInfo plugin = database->pluginForMimeType(mimeType);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+
+ pluginsForMimeType.removeAll(plugin);
+ for (int i = 0; i < pluginsForMimeType.count(); ++i) {
+ QWebPluginInfo anotherPlugin = pluginsForMimeType.at(i);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ QVERIFY(plugin != anotherPlugin);
+
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ database->setPreferredPluginForMimeType(mimeType, anotherPlugin);
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+
+ anotherPlugin.setEnabled(false);
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+
+ anotherPlugin.setEnabled(true);
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+ database->setSearchPaths(database->searchPaths());
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+
+ database->setPreferredPluginForMimeType(mimeType, QWebPluginInfo());
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ }
+ } else {
+ QWebPluginInfo plugin = database->pluginForMimeType(mimeType);
+ QCOMPARE(pluginsMap.value(mimeType), plugin);
+
+ database->setPreferredPluginForMimeType(mimeType, plugin);
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+
+ plugin.setEnabled(false);
+ QCOMPARE(database->pluginForMimeType(mimeType), QWebPluginInfo());
+ plugin.setEnabled(true);
+
+ database->setPreferredPluginForMimeType(mimeType, QWebPluginInfo());
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ }
+
+ ++it;
+ }
+
+ if (pluginsMap.keys().count() >= 2) {
+ QStringList mimeTypes = pluginsMap.uniqueKeys();
+
+ QString mimeType1 = mimeTypes.at(0);
+ QString mimeType2 = mimeTypes.at(1);
+ QWebPluginInfo plugin1 = database->pluginForMimeType(mimeType1);
+ QWebPluginInfo plugin2 = database->pluginForMimeType(mimeType2);
+
+ int i = 2;
+ while (plugin2.supportsMimeType(mimeType1)
+ && !mimeType2.isEmpty()
+ && i < mimeTypes.count()) {
+ mimeType2 = mimeTypes.at(i);
+ plugin2 = database->pluginForMimeType(mimeType2);
+ ++i;
+ }
+
+ plugin1 = database->pluginForMimeType(mimeType1);
+ QVERIFY(plugin1.supportsMimeType(mimeType1));
+ QVERIFY(!plugin1.isNull());
+ plugin2 = database->pluginForMimeType(mimeType2);
+ QVERIFY(plugin2.supportsMimeType(mimeType2));
+ QVERIFY(!plugin2.isNull());
+
+ database->setPreferredPluginForMimeType(mimeType2, plugin1);
+ QVERIFY(!plugin1.supportsMimeType(mimeType2));
+ QCOMPARE(database->pluginForMimeType(mimeType2), plugin2);
+
+ database->setPreferredPluginForMimeType(mimeType1, plugin1);
+ QVERIFY(!plugin2.supportsMimeType(mimeType1));
+ QCOMPARE(database->pluginForMimeType(mimeType2), plugin2);
+ }
+}
+
+void tst_QWebPluginDatabase::operatorassign_data()
+{
+ QTest::addColumn<QWebPluginInfo>("first");
+ QTest::addColumn<QWebPluginInfo>("second");
+
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QTest::newRow("null") << QWebPluginInfo() << QWebPluginInfo();
+
+ QList<QWebPluginInfo> plugins = database->plugins();
+ for (int i = 0; i < (plugins.count() - 1); ++i) {
+ QWebPluginInfo first = plugins.at(i);
+ QWebPluginInfo second = plugins.at(i + 1);
+
+ QTest::newRow(QString("%1=%2").arg(first.name(), second.name()).toUtf8().constData()) << first << second;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorassign()
+{
+ QFETCH(QWebPluginInfo, first);
+ QFETCH(QWebPluginInfo, second);
+
+ QWebPluginInfo info;
+ QCOMPARE(info.mimeTypes(), QList<MimeType>());
+ QCOMPARE(info = first, first);
+ QCOMPARE(info, first);
+ QCOMPARE(info.mimeTypes(), first.mimeTypes());
+ QCOMPARE(info = second, second);
+ QCOMPARE(info, second);
+ QCOMPARE(info.mimeTypes(), second.mimeTypes());
+ QCOMPARE(info = QWebPluginInfo(), QWebPluginInfo());
+ QCOMPARE(info.mimeTypes(), QList<MimeType>());
+}
+
+QTEST_MAIN(tst_QWebPluginDatabase)
+
+#include "tst_qwebplugindatabase.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
index 799ccfb..b7e0fb1 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
@@ -4,3 +4,5 @@ include(../../../../WebKit.pri)
SOURCES += tst_qwebview.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C8
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index 6501bfc..01d0e92 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -25,6 +25,7 @@
#include <qwebpage.h>
#include <qnetworkrequest.h>
#include <qdiriterator.h>
+#include <qwebkitversion.h>
class tst_QWebView : public QObject
{
@@ -40,6 +41,7 @@ private slots:
void renderHints();
void guessUrlFromString_data();
void guessUrlFromString();
+ void getWebKitVersion();
};
// This will be called before the first test function is executed.
@@ -160,6 +162,11 @@ void tst_QWebView::guessUrlFromString()
QCOMPARE(url, guessUrlFromString);
}
+void tst_QWebView::getWebKitVersion()
+{
+ QVERIFY(qWebKitVersion().toDouble() > 0);
+}
+
QTEST_MAIN(tst_QWebView)
#include "tst_qwebview.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
index 7000d32..b5f66ee 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = qwebframe qwebpage qwebelement qwebhistoryinterface qwebview qwebhistory
-SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro
+SUBDIRS = qwebframe qwebpage qwebelement qwebhistoryinterface qwebplugindatabase qwebview qwebhistory
+greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro