summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-09 01:42:56 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-09 01:42:56 (GMT)
commit10620af6eb644e76b762c9f834436bebbb80058f (patch)
treec78de9da0d7bbae1e80ac6862c5c81f30dd7a2b9 /tests
parent5405740678314389e6e5477a3ed76819a60aeb37 (diff)
parent9615dfeca337c9f40d96485d2dd248eb8cefd563 (diff)
downloadQt-10620af6eb644e76b762c9f834436bebbb80058f.zip
Qt-10620af6eb644e76b762c9f834436bebbb80058f.tar.gz
Qt-10620af6eb644e76b762c9f834436bebbb80058f.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp24
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index dbd1f92..8fd5ac0 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -194,6 +194,8 @@ void tst_examples::examples()
QProcess p;
p.start(qmlruntime, arguments);
QVERIFY(p.waitForFinished());
+ if (p.exitStatus() != QProcess::NormalExit || p.exitCode() != 0)
+ qWarning() << p.readAllStandardOutput() << p.readAllStandardError();
QCOMPARE(p.exitStatus(), QProcess::NormalExit);
QCOMPARE(p.exitCode(), 0);
}
diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
index 2b0b151..dd74c09 100644
--- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
+++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp
@@ -73,6 +73,7 @@ private slots:
void sendRequestSoftwareInputPanelEvent();
void setHAlignClearCache();
+ void focusOutClearSelection();
private:
void simulateKey(QDeclarativeView *, int key);
@@ -725,6 +726,29 @@ void tst_qdeclarativetextinput::setHAlignClearCache()
QCOMPARE(input.nbPaint, 2);
}
+void tst_qdeclarativetextinput::focusOutClearSelection()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ QDeclarativeTextInput input;
+ QDeclarativeTextInput input2;
+ input.setText(QLatin1String("Hello world"));
+ input.setFocus(true);
+ scene.addItem(&input2);
+ scene.addItem(&input);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ input.setSelectionStart(2);
+ input.setSelectionEnd(5);
+ //The selection should work
+ QTRY_COMPARE(input.selectedText(), QLatin1String("llo"));
+ input2.setFocus(true);
+ QApplication::processEvents();
+ //The input lost the focus selection should be cleared
+ QTRY_COMPARE(input.selectedText(), QLatin1String(""));
+}
+
QTEST_MAIN(tst_qdeclarativetextinput)
#include "tst_qdeclarativetextinput.moc"