From 194899df2443c72ff38aaed9b1b26fc3a192a6f0 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Thu, 23 Feb 2012 15:49:11 +0200 Subject: Reverted part of "Refactor input context tests" This commit reverts partly 7401832a7d45de99562b94340375393a39267f41 There is something wrong with DummyWindow/XCB/Metacity, Metacity crashes quite often when QWindow is activated. Change-Id: I611af2678814f41c941cb697054135f561a77878 Reviewed-by: Joona Petrell --- .../auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp index c906ebaabe..bc364e37f1 100644 --- a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp +++ b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp @@ -212,18 +212,12 @@ void tst_qinputmethod::cursorRectangle() { QCOMPARE(qApp->inputMethod()->cursorRectangle(), QRectF()); - DummyWindow window; - window.show(); - QTest::qWaitForWindowShown(&window); - window.requestActivateWindow(); - QTRY_COMPARE(qApp->focusWindow(), &window); - window.setFocusObject(&m_inputItem); - QTransform transform; transform.translate(10, 10); transform.scale(2, 2); transform.shear(2, 2); qApp->inputMethod()->setInputItemTransform(transform); + qApp->inputMethod()->setInputItem(&m_inputItem); QCOMPARE(qApp->inputMethod()->cursorRectangle(), transform.mapRect(QRectF(1, 2, 3, 4))); @@ -232,6 +226,7 @@ void tst_qinputmethod::cursorRectangle() // reset m_inputItem.cursorRectangle = QRectF(1, 2, 3, 4); + qApp->inputMethod()->setInputItem(0); qApp->inputMethod()->setInputItemTransform(QTransform()); } @@ -269,13 +264,6 @@ void tst_qinputmethod::commit() void tst_qinputmethod::update() { - DummyWindow window; - window.show(); - QTest::qWaitForWindowShown(&window); - window.requestActivateWindow(); - QTRY_COMPARE(qApp->focusWindow(), &window); - window.setFocusObject(&m_inputItem); - QCOMPARE(m_platformInputContext.m_updateCallCount, 0); QCOMPARE(int(m_platformInputContext.m_lastQueries), int(Qt::ImhNone)); @@ -288,6 +276,9 @@ void tst_qinputmethod::update() QCOMPARE(int(m_platformInputContext.m_lastQueries), int(Qt::ImQueryAll)); QCOMPARE(qApp->inputMethod()->keyboardRectangle(), QRectF(10, 20, 30, 40)); + + // reset + qApp->inputMethod()->setInputItem(0); } void tst_qinputmethod::query() -- cgit v1.2.3