Remove Q_WS_*, symbian and maemo code in QtDeclarative
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qquicktextedit / tst_qquicktextedit.cpp
index a0d36d6..bcc1a4c 100644 (file)
@@ -63,7 +63,7 @@
 #include <private/qtextcontrol_p.h>
 #include "../shared/util.h"
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <Carbon/Carbon.h>
 #endif
 
@@ -1683,31 +1683,18 @@ void tst_qquicktextedit::cursorVisible()
     QCOMPARE(edit.isCursorVisible(), true);
     QCOMPARE(spy.count(), 5);
 
-    QEXPECT_FAIL("", "Most likely a side-effect of QTBUG-21489", Abort);
-    view.setWindowState(Qt::WindowNoState);
+    QQuickView alternateView;
+    alternateView.show();
+    alternateView.requestActivateWindow();
+    QTest::qWaitForWindowShown(&alternateView);
+
     QCOMPARE(edit.isCursorVisible(), false);
     QCOMPARE(spy.count(), 6);
 
     view.requestActivateWindow();
+    QTest::qWaitForWindowShown(&view);
     QCOMPARE(edit.isCursorVisible(), true);
     QCOMPARE(spy.count(), 7);
-
-    // on mac, setActiveWindow(0) on mac does not deactivate the current application
-    // (you have to switch to a different app or hide the current app to trigger this)
-#if !defined(Q_WS_MAC)
-    // on mac, setActiveWindow(0) on mac does not deactivate the current application
-    // (you have to switch to a different app or hide the current app to trigger this)
-//    QApplication::setActiveWindow(0);
-//    QTRY_COMPARE(QApplication::focusWindow(), static_cast<QWidget *>(0));
-//    QCOMPARE(edit.isCursorVisible(), false);
-//    QCOMPARE(spy.count(), 8);
-
-//    view.requestActivateWindow();
-//    QTest::qWaitForWindowShown(&view);
-//    QTRY_COMPARE(view.windowState(), Qt::WindowActive);
-//    QCOMPARE(edit.isCursorVisible(), true);
-//    QCOMPARE(spy.count(), 9);
-#endif
 }
 
 void tst_qquicktextedit::delegateLoading_data()
@@ -1793,7 +1780,7 @@ void tst_qquicktextedit::navigation()
 void tst_qquicktextedit::copyAndPaste() {
 #ifndef QT_NO_CLIPBOARD
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     {
         PasteboardRef pasteboard;
         OSStatus status = PasteboardCreate(0, &pasteboard);
@@ -2220,9 +2207,7 @@ void tst_qquicktextedit::preeditMicroFocus()
     ic.sendPreeditText(preeditText, 0);
     currentRect = edit->inputMethodQuery(Qt::ImCursorRectangle).toRect();
     QCOMPARE(currentRect, previousRect);
-#if defined(Q_WS_X11) || defined(Q_WS_QWS)
     QCOMPARE(ic.updateReceived, false); // The cursor position hasn't changed.
-#endif
     QCOMPARE(cursorRectangleSpy.count(), 0);
 
     // Verify that the micro focus rect moves to the left as the cursor position
@@ -2232,9 +2217,7 @@ void tst_qquicktextedit::preeditMicroFocus()
         ic.sendPreeditText(preeditText, i);
         currentRect = edit->inputMethodQuery(Qt::ImCursorRectangle).toRect();
         QVERIFY(previousRect.left() < currentRect.left());
-#if defined(Q_WS_X11) || defined(Q_WS_QWS)
         QCOMPARE(ic.updateReceived, true);
-#endif
         QVERIFY(cursorRectangleSpy.count() > 0);
         cursorRectangleSpy.clear();
         previousRect = currentRect;
@@ -2247,9 +2230,7 @@ void tst_qquicktextedit::preeditMicroFocus()
     ic.sendEvent(QInputMethodEvent(preeditText, QList<QInputMethodEvent::Attribute>()));
     currentRect = edit->inputMethodQuery(Qt::ImCursorRectangle).toRect();
     QCOMPARE(currentRect, previousRect);
-#if defined(Q_WS_X11) || defined(Q_WS_QWS)
     QCOMPARE(ic.updateReceived, true);
-#endif
     QVERIFY(cursorRectangleSpy.count() > 0);
 #endif
 }