1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: maliit-discuss@lists.maliit.org
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License version 2.1 as published by the Free Software Foundation
11
* and appearing in the file LICENSE.LGPL included in the packaging
15
#include "ut_mimrotationanimation.h"
17
#include "mimxapplication.h"
18
#include "mimrotationanimation.h"
20
#include "gui-utils.h"
23
const QSize windowSize(200, 200);
26
void Ut_MImRotationAnimation::initTestCase()
28
static char *argv[1] = { (char *) "Ut_MImRotationAnimation" };
31
// Enforcing raster GS to make test reliable:
32
QApplication::setGraphicsSystem("raster");
34
app = new MImXApplication(argc, argv, xOptions);
36
remote = new MaliitTestUtils::RemoteWindow;
37
remote->setGeometry(0, 0, windowSize.width(), windowSize.height());
40
QTest::qWaitForWindowShown(remote->window());
43
void Ut_MImRotationAnimation::cleanupTestCase()
49
void Ut_MImRotationAnimation::testPassthruHiddenDuringRotation()
51
QSKIP("Unreliable on Device", SkipAll);
53
MImXServerLogic *serverLogic = app->serverLogic();
55
MImRotationAnimation subject(serverLogic->passThruWindow(), 0, serverLogic, xOptions);
56
serverLogic->applicationFocusChanged(remote->window()->effectiveWinId());
58
subject.appOrientationChangeFinished(0);
60
QMetaObject::invokeMethod(serverLogic->passThruWindow(), "inputPassthrough", Qt::DirectConnection,
61
Q_ARG(QRegion, QRegion(QRect(QPoint(), QSize(600, 400)))));
62
subject.appOrientationAboutToChange(270);
63
QVERIFY(subject.isVisible());
65
QMetaObject::invokeMethod(serverLogic->passThruWindow(), "inputPassthrough", Qt::DirectConnection,
66
Q_ARG(QRegion, QRegion()));
67
subject.appOrientationChangeFinished(270);
68
QVERIFY(!subject.isVisible());
71
QTEST_APPLESS_MAIN(Ut_MImRotationAnimation);