summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-05-26 10:11:43 +0100
committerSteve Block <steveblock@google.com>2010-05-27 11:14:42 +0100
commite78cbe89e6f337f2f1fe40315be88f742b547151 (patch)
treed778000b84a04f24bbad50c7fa66244365e960e9 /WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
parent7b582e96e4e909ed7dba1e07153d20fbddaec3f7 (diff)
downloadexternal_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.zip
external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.gz
external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.bz2
Merge WebKit at r60074: Initial merge by git
Change-Id: I18a2dc5439e36c928351ea829d8fb4e39b062fc7
Diffstat (limited to 'WebKit/qt/tests/qwebframe/tst_qwebframe.cpp')
-rw-r--r--WebKit/qt/tests/qwebframe/tst_qwebframe.cpp37
1 files changed, 27 insertions, 10 deletions
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index bea7a67..76fdba3 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -600,7 +600,12 @@ private slots:
void setHtmlWithBaseURL();
void ipv6HostEncoding();
void metaData();
+#if !defined(Q_WS_MAEMO_5)
+ // as maemo 5 does not use QComboBoxes to implement the popups
+ // this test does not make sense for it.
void popupFocus();
+#endif
+ void inputFieldFocus();
void hitTestContent();
void jsByteArray();
void ownership();
@@ -686,13 +691,13 @@ private:
QWebView* m_view;
QWebPage* m_page;
MyQObject* m_myObject;
- QWebView* m_popupTestView;
- int m_popupTestPaintCount;
+ QWebView* m_inputFieldsTestView;
+ int m_inputFieldTestPaintCount;
};
tst_QWebFrame::tst_QWebFrame()
: sTrue("true"), sFalse("false"), sUndefined("undefined"), sArray("array"), sFunction("function"), sError("error"),
- sString("string"), sObject("object"), sNumber("number"), m_popupTestView(0), m_popupTestPaintCount(0)
+ sString("string"), sObject("object"), sNumber("number"), m_inputFieldsTestView(0), m_inputFieldTestPaintCount(0)
{
}
@@ -702,10 +707,10 @@ tst_QWebFrame::~tst_QWebFrame()
bool tst_QWebFrame::eventFilter(QObject* watched, QEvent* event)
{
- // used on the popupFocus test
- if (watched == m_popupTestView) {
+ // used on the inputFieldFocus test
+ if (watched == m_inputFieldsTestView) {
if (event->type() == QEvent::Paint)
- m_popupTestPaintCount++;
+ m_inputFieldTestPaintCount++;
}
return QObject::eventFilter(watched, event);
}
@@ -780,7 +785,7 @@ void tst_QWebFrame::getSetStaticProperty()
QCOMPARE(vm.size(), 3);
QCOMPARE(vm.value("a").toInt(), 123);
QCOMPARE(vm.value("b").toString(), QLatin1String("foo"));
- QCOMPARE(vm.value("c").value<QObject*>(), m_myObject);
+ QCOMPARE(vm.value("c").value<QObject*>(), static_cast<QObject*>(m_myObject));
}
QCOMPARE(evalJS("myObject.variantMapProperty.a === 123"), sTrue);
QCOMPARE(evalJS("myObject.variantMapProperty.b === 'foo'"), sTrue);
@@ -2549,6 +2554,7 @@ void tst_QWebFrame::metaData()
QCOMPARE(metaData.value("nonexistant"), QString());
}
+#if !defined(Q_WS_MAEMO_5)
void tst_QWebFrame::popupFocus()
{
QWebView view;
@@ -2580,16 +2586,27 @@ void tst_QWebFrame::popupFocus()
// hide the popup and check if focus is on the page
combo->hidePopup();
QTRY_VERIFY(view.hasFocus() && !combo->view()->hasFocus()); // Focus should be back on the WebView
+}
+#endif
+
+void tst_QWebFrame::inputFieldFocus()
+{
+ QWebView view;
+ view.setHtml("<html><body><input type=\"text\"></input></body></html>");
+ view.resize(400, 100);
+ view.show();
+ view.setFocus();
+ QTRY_VERIFY(view.hasFocus());
// double the flashing time, should at least blink once already
int delay = qApp->cursorFlashTime() * 2;
// focus the lineedit and check if it blinks
- QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(200, 25));
- m_popupTestView = &view;
+ QTest::mouseClick(&view, Qt::LeftButton, 0, QPoint(25, 25));
+ m_inputFieldsTestView = &view;
view.installEventFilter( this );
QTest::qWait(delay);
- QVERIFY2(m_popupTestPaintCount >= 3,
+ QVERIFY2(m_inputFieldTestPaintCount >= 3,
"The input field should have a blinking caret");
}