aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-10 10:01:12 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-10 10:01:27 +0200
commit8a793defa79bd332742cadeabfe05cbaa5516877 (patch)
tree85f28038d29452fae858723dc7b7e5f0df9dcb42 /tests/auto/quick
parentcbc86ae4d4af719f201e5f62aa07ef4a763eecee (diff)
parente4fc75edaedead3092aace3a29a0aafdd0e86a77 (diff)
Merge remote-tracking branch 'origin/release' into stable
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp16
-rw-r--r--tests/auto/quick/touchmouse/tst_touchmouse.cpp20
2 files changed, 24 insertions, 12 deletions
diff --git a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
index 73474afbd7..0377eaa71d 100644
--- a/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
+++ b/tests/auto/quick/qquickanimatedimage/tst_qquickanimatedimage.cpp
@@ -190,9 +190,6 @@ void tst_qquickanimatedimage::mirror_running()
QImage frame0_expected = frame0.transformed(transform);
QImage frame1_expected = frame1.transformed(transform);
-#ifdef Q_OS_MAC
- QSKIP("QTBUG-31370 - sometimes fails on Mac");
-#endif
QCOMPARE(frame0_flipped, frame0_expected);
QCOMPARE(frame1_flipped, frame1_expected);
@@ -204,29 +201,28 @@ void tst_qquickanimatedimage::mirror_notRunning()
QFETCH(QUrl, fileUrl);
QQuickView window;
+ window.setSource(fileUrl);
window.show();
+ QTRY_VERIFY(window.isExposed());
- window.setSource(fileUrl);
QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(window.rootObject());
QVERIFY(anim);
int width = anim->property("width").toInt();
- QPixmap screenshot = QPixmap::fromImage(window.grabWindow());
+ QImage screenshot = window.grabWindow();
QTransform transform;
transform.translate(width, 0).scale(-1, 1.0);
- QPixmap expected = screenshot.transformed(transform);
+ QImage expected = screenshot.transformed(transform);
int frame = anim->currentFrame();
bool playing = anim->isPlaying();
bool paused = anim->isPlaying();
anim->setProperty("mirror", true);
- screenshot = QPixmap::fromImage(window.grabWindow());
+ screenshot = window.grabWindow();
-#ifdef Q_OS_MAC
- QSKIP("QTBUG-31370 - sometimes fails on Mac");
-#endif
+ screenshot.save("screen.png");
QCOMPARE(screenshot, expected);
// mirroring should not change the current frame or playing status
diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
index 15a4f0cc27..4779942406 100644
--- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp
+++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
@@ -195,8 +195,9 @@ void tst_TouchMouse::simpleTouchEvent()
window->setSource(testFileUrl("singleitem.qml"));
window->show();
- window->requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(window));
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
@@ -344,7 +345,9 @@ void tst_TouchMouse::mouse()
window->setSource(testFileUrl("twoitems.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
@@ -376,7 +379,9 @@ void tst_TouchMouse::touchOverMouse()
window->setSource(testFileUrl("twoitems.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
@@ -417,7 +422,9 @@ void tst_TouchMouse::mouseOverTouch()
window->setSource(testFileUrl("twoitems.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
@@ -461,7 +468,9 @@ void tst_TouchMouse::buttonOnFlickable()
window->setSource(testFileUrl("buttononflickable.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = window->rootObject()->findChild<QQuickFlickable*>("flickable");
@@ -569,7 +578,9 @@ void tst_TouchMouse::buttonOnTouch()
QQuickView *window = createView();
window->setSource(testFileUrl("buttonontouch.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
@@ -691,7 +702,9 @@ void tst_TouchMouse::pinchOnFlickable()
QQuickView *window = createView();
window->setSource(testFileUrl("pinchonflickable.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
@@ -758,7 +771,9 @@ void tst_TouchMouse::flickableOnPinch()
QQuickView *window = createView();
window->setSource(testFileUrl("flickableonpinch.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
@@ -935,8 +950,9 @@ void tst_TouchMouse::tapOnDismissiveTopMouseAreaClicksBottomOne()
window->setSource(testFileUrl("twoMouseAreas.qml"));
window->show();
- window->requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(window));
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *bottomMouseArea =