summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/tests
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-11-09 17:38:17 (GMT)
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-11-10 09:30:24 (GMT)
commitd15d7385cb6cfb453ab08d6d7154b66c3fb087ee (patch)
tree14bc24f2fde81d5d93958be7662d4cdc0a527529 /src/3rdparty/webkit/WebKit/qt/tests
parent7bfdec392df263b15fb5661ab7d4f66f1cd8fbae (diff)
downloadQt-d15d7385cb6cfb453ab08d6d7154b66c3fb087ee.zip
Qt-d15d7385cb6cfb453ab08d6d7154b66c3fb087ee.tar.gz
Qt-d15d7385cb6cfb453ab08d6d7154b66c3fb087ee.tar.bz2
Updated WebKit from /home/jturcott/dev/webkit/ to qtwebkit/qtwebkit-4.6 ( 363898ca378e2198b855ca2f8921c5e4f898c5e2 )
Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-11-09 Benjamin Poulain <benjamin.poulain@nokia.com> Reviewed by Kenneth Rohde Christiansen. https://bugs.webkit.org/show_bug.cgi?id=30772 Add a non-const iterator to QWebElementCollection. Move the two attributes of the iterator to private. * Api/qwebelement.h: (const_iterator::begin): (const_iterator::end): (const_iterator::constBegin): (const_iterator::constEnd): (const_iterator::iterator::iterator): (const_iterator::iterator::operator*): (const_iterator::iterator::operator==): (const_iterator::iterator::operator!=): (const_iterator::iterator::operator<): (const_iterator::iterator::operator<=): (const_iterator::iterator::operator>): (const_iterator::iterator::operator>=): (const_iterator::iterator::operator++): (const_iterator::iterator::operator--): (const_iterator::iterator::operator+=): (const_iterator::iterator::operator-=): (const_iterator::iterator::operator+): (const_iterator::iterator::operator-): * tests/qwebelement/tst_qwebelement.cpp: (tst_QWebElement::nonConstIterator): (tst_QWebElement::constIterator): 2009-11-09 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Kenneth Christiansen. [Qt] Remove the sessionStorage setting (per Page) https://bugs.webkit.org/show_bug.cgi?id=31249 This setting allows to run sessionStorage on/off on a per page basis. Remove this prematurely exposed API. * Api/qwebsettings.cpp: (QWebSettingsPrivate::apply): (QWebSettings::QWebSettings): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::database): (tst_QWebPage::testOptionalJSObjects): 2009-11-09 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed by Simon Hausmann. [Qt] Remove the QWebPage:webInspectorTriggered signal. User customization of the communication between QWebPage and QWebInspector will be properly designed in the next version. https://bugs.webkit.org/show_bug.cgi?id=30773 * Api/qwebinspector.cpp: * Api/qwebpage.cpp: (QWebPagePrivate::getOrCreateInspector): (QWebPage::triggerAction): * Api/qwebpage.h: * QtLauncher/main.cpp: (MainWindow::MainWindow): 2009-11-05 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Added a missing re-implementation of QGraphicsItem::inputMethodQuery(). * Api/qgraphicswebview.cpp: (QGraphicsWebView::inputMethodQuery): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Provide a dummy re-implementation of QGraphicsLayoutItem::sizeHint(), similar to QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::sizeHint): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Removed zoomFactoryChanged() signal and added linkClicked() to QGraphicsWebView, for consistency with QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::setPage): (QGraphicsWebView::setZoomFactor): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Added QGraphicsWebView::findText() for convenience and consistency with QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::findText): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Added QGraphicsWebView::pageAction() and triggerPageAction(), for consistency with QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::pageAction): (QGraphicsWebView::triggerPageAction): * Api/qgraphicswebview.h: 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Removed QGraphicsWebView::toHtml() after API review. That's consistent with QWebView and also based on the assumption that toHtml() is called less frequently than setHtml(). * Api/qgraphicswebview.cpp: * Api/qgraphicswebview.h: * tests/qgraphicswebview/tst_qgraphicswebview.cpp: (tst_QGraphicsWebView::qgraphicswebview): 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Removed the interactive property of QGraphicsWebView. There are clearly use-cases for this feature, but it will require more work to make this fully work with an enum to have fine-grained control over the interactivity levels. For now it is easy to achieve in user-code what the boolean property did. * Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): (QGraphicsWebView::hoverMoveEvent): (QGraphicsWebView::mouseMoveEvent): (QGraphicsWebView::mousePressEvent): (QGraphicsWebView::mouseReleaseEvent): (QGraphicsWebView::mouseDoubleClickEvent): (QGraphicsWebView::keyPressEvent): (QGraphicsWebView::keyReleaseEvent): (QGraphicsWebView::dragLeaveEvent): (QGraphicsWebView::dragMoveEvent): (QGraphicsWebView::dropEvent): (QGraphicsWebView::wheelEvent): (QGraphicsWebView::inputMethodEvent): * Api/qgraphicswebview.h: * tests/qgraphicswebview/tst_qgraphicswebview.cpp: (tst_QGraphicsWebView::qgraphicswebview): 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Make the QGraphicsWebView constructor explicit. * Api/qgraphicswebview.h: 2009-11-05 Simon Hausmann <hausmann@webkit.org> Last Qt 4.5 build fix (*sigh*) * tests/qwebpage/tst_qwebpage.cpp: (inputMethodHints): inputMethodHints() is only used for Qt 4.6, so guard the whole function. 2009-11-05 Simon Hausmann <hausmann@webkit.org> Another prospective build fix against Qt 4.5 (build bot) Don't compile & run the QGraphicsWebView portion of the input methods auto test with Qt 4.5. * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::inputMethods_data): (inputMethodHints): (inputMethodEnabled): (tst_QWebPage::inputMethods): 2009-11-05 Simon Hausmann <hausmann@webkit.org> Prospective build fix against Qt 4.5 (build bot) * Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::setInputMethodEnabled): Guard the use of Qt 4.6 specific API with #ifdefs. 2009-11-01 Simon Hausmann <hausmann@webkit.org> Reviewed by Kenneth Christiansen. [Qt] Fix enabling of input method support on QGraphicsWebView. https://bugs.webkit.org/show_bug.cgi?id=30605 Instead of setting the unsupported widget attribute on the QGraphicsWidget in setInputMethodEnabled() set the ItemAcceptsInputMethod GraphicsItem flag directly. Changed the existing input method auto test to run once on a QWebView and once on a QGraphicsWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::setInputMethodEnabled): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::inputMethods_data): (inputMethodHints): (inputMethodEnabled): (tst_QWebPage::inputMethods): 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Kenneth Christiansen. Added QGraphicsWebView::modified property, for consistency with QWebView. * Api/qgraphicswebview.cpp: (QGraphicsWebView::isModified): * Api/qgraphicswebview.h: * tests/qgraphicswebview/tst_qgraphicswebview.cpp: (tst_QGraphicsWebView::qgraphicswebview): 2009-11-04 Simon Hausmann <hausmann@webkit.org> Reviewed by Kenneth Christiansen. Removed status and progress properties of QGraphicsWebView. Added loadProgress and statusBarMessage signals instead, after API review. * Api/qgraphicswebview.cpp: (QGraphicsWebViewPrivate::QGraphicsWebViewPrivate): (QGraphicsWebView::setPage): * Api/qgraphicswebview.h: * tests/qgraphicswebview/tst_qgraphicswebview.cpp: (tst_QGraphicsWebView::qgraphicswebview):
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/tests')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp33
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp125
6 files changed, 126 insertions, 46 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
index 4bdb7f5..a52e167 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp
@@ -63,21 +63,17 @@ void tst_QGraphicsWebView::qgraphicswebview()
item.title();
item.icon();
item.zoomFactor();
- item.isInteractive();
- item.progress();
- item.toHtml();
item.history();
item.settings();
- item.status();
item.page();
item.setPage(0);
item.page();
item.setUrl(QUrl());
item.setZoomFactor(0);
- item.setInteractive(true);
item.load(QUrl());
item.setHtml(QString());
item.setContent(QByteArray());
+ item.isModified();
}
class WebPage : public QWebPage
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
index cf83fe8..117393a 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
@@ -71,6 +71,8 @@ private slots:
void classes();
void namespaceURI();
void iteration();
+ void nonConstIterator();
+ void constIterator();
void foreachManipulation();
void emptyCollection();
void appendCollection();
@@ -305,6 +307,37 @@ void tst_QWebElement::iteration()
QCOMPARE(paras.at(1), paras.last());
}
+void tst_QWebElement::nonConstIterator()
+{
+ QString html = "<body><p>first para</p><p>second para</p></body>";
+ m_mainFrame->setHtml(html);
+ QWebElement body = m_mainFrame->documentElement();
+ QWebElementCollection paras = body.findAll("p");
+
+ QWebElementCollection::iterator it = paras.begin();
+ QCOMPARE(*it, paras.at(0));
+ ++it;
+ (*it).encloseWith("<div>");
+ QCOMPARE(*it, paras.at(1));
+ ++it;
+ QCOMPARE(it, paras.end());
+}
+
+void tst_QWebElement::constIterator()
+{
+ QString html = "<body><p>first para</p><p>second para</p></body>";
+ m_mainFrame->setHtml(html);
+ QWebElement body = m_mainFrame->documentElement();
+ const QWebElementCollection paras = body.findAll("p");
+
+ QWebElementCollection::const_iterator it = paras.begin();
+ QCOMPARE(*it, paras.at(0));
+ ++it;
+ QCOMPARE(*it, paras.at(1));
+ ++it;
+ QCOMPARE(it, paras.end());
+}
+
void tst_QWebElement::foreachManipulation()
{
QString html = "<body><p>first para</p><p>second para</p></body>";
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
index b8734cd..0e540e5 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -5,7 +5,7 @@ SOURCES += tst_qwebframe.cpp
RESOURCES += qwebframe.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\"
+DEFINES += SRCDIR=\\\"$$PWD/resources\\\"
symbian {
TARGET.UID3 = 0xA000E53D
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 6f07e90..7cc62b0 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -38,10 +38,6 @@
#endif
#include "../util.h"
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
//TESTED_CLASS=
//TESTED_FILES=
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
index 7853b28..6b28efd 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -5,7 +5,7 @@ SOURCES += tst_qwebpage.cpp
RESOURCES += tst_qwebpage.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
symbian {
TARGET.UID3 = 0xA000E53E
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 3eead92..87077e0 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -21,6 +21,9 @@
#include <QtTest/QtTest>
+#include <qgraphicsscene.h>
+#include <qgraphicsview.h>
+#include <qgraphicswebview.h>
#include <qwebelement.h>
#include <qwebpage.h>
#include <qwidget.h>
@@ -37,10 +40,6 @@
#include <QPushButton>
#include <QDir>
-#if defined(Q_OS_SYMBIAN)
-# define SRCDIR ""
-#endif
-
// Will try to wait for the condition while allowing event processing
#define QTRY_COMPARE(__expr, __expected) \
do { \
@@ -124,6 +123,7 @@ private slots:
void testOptionalJSObjects();
void testEnablePersistentStorage();
void consoleOutput();
+ void inputMethods_data();
void inputMethods();
void defaultTextEncoding();
void errorPageExtension();
@@ -456,7 +456,6 @@ void tst_QWebPage::database()
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";
@@ -1268,28 +1267,87 @@ void tst_QWebPage::frameAt()
frameAtHelper(webPage, webPage->mainFrame(), webPage->mainFrame()->pos());
}
+void tst_QWebPage::inputMethods_data()
+{
+ QTest::addColumn<QString>("viewType");
+ QTest::newRow("QWebView") << "QWebView";
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QTest::newRow("QGraphicsWebView") << "QGraphicsWebView";
+#endif
+}
+
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+static Qt::InputMethodHints inputMethodHints(QObject* object)
+{
+ if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
+ return o->inputMethodHints();
+ if (QWidget* w = qobject_cast<QWidget*>(object))
+ return w->inputMethodHints();
+ return Qt::InputMethodHints();
+}
+#endif
+
+static bool inputMethodEnabled(QObject* object)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ if (QGraphicsObject* o = qobject_cast<QGraphicsObject*>(object))
+ return o->flags() & QGraphicsItem::ItemAcceptsInputMethod;
+#endif
+ if (QWidget* w = qobject_cast<QWidget*>(object))
+ return w->testAttribute(Qt::WA_InputMethodEnabled);
+ return false;
+}
+
void tst_QWebPage::inputMethods()
{
- m_view->page()->mainFrame()->setHtml("<html><body>" \
+ QFETCH(QString, viewType);
+ QWebPage* page = new QWebPage;
+ QObject* view = 0;
+ QObject* container = 0;
+ if (viewType == "QWebView") {
+ QWebView* wv = new QWebView;
+ wv->setPage(page);
+ view = wv;
+ container = view;
+ }
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ else if (viewType == "QGraphicsWebView") {
+ QGraphicsWebView* wv = new QGraphicsWebView;
+ wv->setPage(page);
+ view = wv;
+
+ QGraphicsView* gv = new QGraphicsView;
+ QGraphicsScene* scene = new QGraphicsScene(gv);
+ gv->setScene(scene);
+ scene->addItem(wv);
+ wv->setGeometry(QRect(0, 0, 500, 500));
+
+ container = gv;
+ }
+#endif
+ else
+ QVERIFY2(false, "Unknown view type");
+
+ page->mainFrame()->setHtml("<html><body>" \
"<input type='text' id='input1' style='font-family: serif' value='' maxlength='20'/><br>" \
"<input type='password'/>" \
"</body></html>");
- m_view->page()->mainFrame()->setFocus();
+ page->mainFrame()->setFocus();
- QWebElementCollection inputs = m_view->page()->mainFrame()->documentElement().findAll("input");
+ QWebElementCollection inputs = page->mainFrame()->documentElement().findAll("input");
QMouseEvent evpres(QEvent::MouseButtonPress, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
- m_view->page()->event(&evpres);
+ page->event(&evpres);
QMouseEvent evrel(QEvent::MouseButtonRelease, inputs.at(0).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
- m_view->page()->event(&evrel);
+ page->event(&evrel);
//ImMicroFocus
- QVariant variant = m_view->page()->inputMethodQuery(Qt::ImMicroFocus);
+ QVariant variant = page->inputMethodQuery(Qt::ImMicroFocus);
QRect focusRect = variant.toRect();
QVERIFY(inputs.at(0).geometry().contains(variant.toRect().topLeft()));
//ImFont
- variant = m_view->page()->inputMethodQuery(Qt::ImFont);
+ variant = page->inputMethodQuery(Qt::ImFont);
QFont font = variant.value<QFont>();
QCOMPARE(QString("-webkit-serif"), font.family());
@@ -1298,45 +1356,45 @@ void tst_QWebPage::inputMethods()
//Insert text.
{
QInputMethodEvent eventText("QtWebKit", inputAttributes);
- QSignalSpy signalSpy(m_view->page(), SIGNAL(microFocusChanged()));
- m_view->page()->event(&eventText);
+ QSignalSpy signalSpy(page, SIGNAL(microFocusChanged()));
+ page->event(&eventText);
QCOMPARE(signalSpy.count(), 0);
}
{
QInputMethodEvent eventText("", inputAttributes);
eventText.setCommitString(QString("QtWebKit"), 0, 0);
- m_view->page()->event(&eventText);
+ page->event(&eventText);
}
#if QT_VERSION >= 0x040600
//ImMaximumTextLength
- variant = m_view->page()->inputMethodQuery(Qt::ImMaximumTextLength);
+ variant = page->inputMethodQuery(Qt::ImMaximumTextLength);
QCOMPARE(20, variant.toInt());
//Set selection
inputAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 3, 2, QVariant());
QInputMethodEvent eventSelection("",inputAttributes);
- m_view->page()->event(&eventSelection);
+ page->event(&eventSelection);
//ImAnchorPosition
- variant = m_view->page()->inputMethodQuery(Qt::ImAnchorPosition);
+ variant = page->inputMethodQuery(Qt::ImAnchorPosition);
int anchorPosition = variant.toInt();
QCOMPARE(anchorPosition, 3);
//ImCursorPosition
- variant = m_view->page()->inputMethodQuery(Qt::ImCursorPosition);
+ variant = page->inputMethodQuery(Qt::ImCursorPosition);
int cursorPosition = variant.toInt();
QCOMPARE(cursorPosition, 5);
//ImCurrentSelection
- variant = m_view->page()->inputMethodQuery(Qt::ImCurrentSelection);
+ variant = page->inputMethodQuery(Qt::ImCurrentSelection);
QString selectionValue = variant.value<QString>();
QCOMPARE(selectionValue, QString("eb"));
#endif
//ImSurroundingText
- variant = m_view->page()->inputMethodQuery(Qt::ImSurroundingText);
+ variant = page->inputMethodQuery(Qt::ImSurroundingText);
QString value = variant.value<QString>();
QCOMPARE(value, QString("QtWebKit"));
@@ -1347,29 +1405,31 @@ void tst_QWebPage::inputMethods()
QInputMethodEvent::Attribute newSelection(QInputMethodEvent::Selection, 0, 0, QVariant());
attributes.append(newSelection);
QInputMethodEvent event("composition", attributes);
- m_view->page()->event(&event);
+ page->event(&event);
}
// A ongoing composition should not change the surrounding text before it is committed.
- variant = m_view->page()->inputMethodQuery(Qt::ImSurroundingText);
+ variant = page->inputMethodQuery(Qt::ImSurroundingText);
value = variant.value<QString>();
QCOMPARE(value, QString("QtWebKit"));
#endif
//ImhHiddenText
QMouseEvent evpresPassword(QEvent::MouseButtonPress, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
- m_view->page()->event(&evpresPassword);
+ page->event(&evpresPassword);
QMouseEvent evrelPassword(QEvent::MouseButtonRelease, inputs.at(1).geometry().center(), Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
- m_view->page()->event(&evrelPassword);
+ page->event(&evrelPassword);
- QVERIFY(m_view->testAttribute(Qt::WA_InputMethodEnabled));
+ QVERIFY(inputMethodEnabled(view));
#if QT_VERSION >= 0x040600
- QVERIFY(m_view->inputMethodHints() & Qt::ImhHiddenText);
+ QVERIFY(inputMethodHints(view) & Qt::ImhHiddenText);
- m_view->page()->event(&evpres);
- m_view->page()->event(&evrel);
- QVERIFY(!(m_view->inputMethodHints() & Qt::ImhHiddenText));
+ page->event(&evpres);
+ page->event(&evrel);
+ QVERIFY(!(inputMethodHints(view) & Qt::ImhHiddenText));
#endif
+
+ delete container;
}
// import a little DRT helper function to trigger the garbage collector
@@ -1444,11 +1504,6 @@ void tst_QWebPage::testOptionalJSObjects()
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()