aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2011-11-09 14:57:23 +1000
committerQt by Nokia <qt-info@nokia.com>2011-11-10 07:37:50 +0100
commitfbbc0932e1be389631529f8912964463650e93e9 (patch)
treebfe5eefc72af6deba14e708acd5671ae74f3da5a /tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp
parentd6bcd072520ee48a6caf1077c66cb05d412dd9e4 (diff)
Fix expected failure in TextInput horizontalAlignment_RightToLeft test.
Send events to the input panels input item instead of the canvas. And clear the pre-edit text before testing implicit alignment of empty text. Change-Id: I5e6b04c53c9c6b344563b80b3aa76ab614b0ca0a Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp')
-rw-r--r--tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp
index 62f5e0391d..95b52196c5 100644
--- a/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp
@@ -1162,12 +1162,15 @@ void tst_qquicktextinput::horizontalAlignment_RightToLeft()
// If there is no commited text, the preedit text should determine the alignment.
textInput->setText(QString());
- { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QGuiApplication::sendEvent(&canvas, &ev); }
- QEXPECT_FAIL("", "QTBUG-21691", Continue);
+ { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QGuiApplication::sendEvent(qGuiApp->inputPanel()->inputItem(), &ev); }
QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight);
- { QInputMethodEvent ev("Hello world!", QList<QInputMethodEvent::Attribute>()); QGuiApplication::sendEvent(&canvas, &ev); }
+ { QInputMethodEvent ev("Hello world!", QList<QInputMethodEvent::Attribute>()); QGuiApplication::sendEvent(qGuiApp->inputPanel()->inputItem(), &ev); }
QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignLeft);
+ // Clear pre-edit text. TextInput should maybe do this itself on setText, but that may be
+ // redundant as an actual input method may take care of it.
+ { QInputMethodEvent ev; QGuiApplication::sendEvent(qGuiApp->inputPanel()->inputItem(), &ev); }
+
#ifdef Q_OS_MAC
// empty text with implicit alignment follows the system locale-based
// keyboard input direction from QGuiApplication::keyboardInputDirection