summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_textfield.qml
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2013-06-21 10:13:11 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-28 13:24:21 +0200
commit120d7274e971e520ecbeb87f3e23459a73cb40fa (patch)
tree8efca6aefa93eb2e8f153565196f446a3c823cf3 /tests/auto/controls/data/tst_textfield.qml
parent299dc3b6ef851ede8d0da28257520009ca0d0bba (diff)
downloadqtquickcontrols-120d7274e971e520ecbeb87f3e23459a73cb40fa.tar.gz
Tests: Fix test for copy/paste for TextField
The copy() function was testing nothing and was not called. Change-Id: I2b23e1cd206e0247949173f4aee8c60852c5b0d1 Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_textfield.qml')
-rw-r--r--tests/auto/controls/data/tst_textfield.qml5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_textfield.qml b/tests/auto/controls/data/tst_textfield.qml
index 6c5ce6b5..382e07c6 100644
--- a/tests/auto/controls/data/tst_textfield.qml
+++ b/tests/auto/controls/data/tst_textfield.qml
@@ -200,11 +200,14 @@ TestCase {
textfield.destroy()
}
- function copy() {
+ function test_copyPaste() {
var textfield = Qt.createQmlObject('import QtQuick.Controls 1.0; TextField {}', testCase, '')
textfield.text = "this is my text"
textfield.select(0, 5)
textfield.copy()
+ textfield.cursorPosition = 0
+ textfield.paste()
+ compare(textfield.text, "this this is my text")
textfield.destroy()
}