diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-04-10 12:48:01 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-04-10 15:31:45 +0200 |
commit | 143c4d3e13a430b951f4f4f8c28db14303f80605 (patch) | |
tree | 2b89637b93fc7d81c674106008566010f986d67c /tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp | |
parent | a7ed81b557d593a8ddb43b71bf4bbf3b44ead070 (diff) | |
parent | e5337ad1b1fb02873ce7b5ca8db45f6fd8063352 (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
configure
src/widgets/styles/qwindowsxpstyle.cpp
tests/auto/gui/kernel/qwindow/qwindow.pro
tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
Diffstat (limited to 'tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp')
-rw-r--r-- | tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp index 3810546146..cfe26d23e7 100644 --- a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp +++ b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp @@ -122,6 +122,8 @@ private slots: void update(); void query(); void inputDirection(); + void inputMethodAccepted(); + private: InputItem m_inputItem; PlatformInputContext m_platformInputContext; @@ -304,5 +306,23 @@ void tst_qinputmethod::inputDirection() QCOMPARE(m_platformInputContext.m_localeCallCount, 1); } +void tst_qinputmethod::inputMethodAccepted() +{ + InputItem disabledItem; + disabledItem.setEnabled(false); + + DummyWindow window; + window.show(); + QTest::qWaitForWindowShown(&window); + window.requestActivateWindow(); + QTRY_COMPARE(qApp->focusWindow(), &window); + window.setFocusObject(&disabledItem); + + QCOMPARE(m_platformInputContext.inputMethodAccepted(), false); + + window.setFocusObject(&m_inputItem); + QCOMPARE(m_platformInputContext.inputMethodAccepted(), true); +} + QTEST_MAIN(tst_qinputmethod) #include "tst_qinputmethod.moc" |