~timo-jyrinki/ubuntu/trusty/maliit-framework/fix_qt52

« back to all changes in this revision

Viewing changes to tests/ut_mimrotationanimation/ut_mimrotationanimation.cpp

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo, Sergio Schvezov, Ricardo Salveti de Araujo
  • Date: 2013-07-23 19:47:04 UTC
  • mfrom: (1.1.2) (1.2.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130723194704-1lsy1kmlda069cea
Tags: 0.99.0+git20130615+97e8335-0ubuntu1
[ Sergio Schvezov ]
* New build from HEAD 97e8335.
* Packaging import from lp:phablet-extras/maliit-framework.

[ Ricardo Salveti de Araujo ]
* debian/control: adding vcs and fixing dependencies
* General package cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* * This file is part of Maliit framework *
2
 
 *
3
 
 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4
 
 * All rights reserved.
5
 
 *
6
 
 * Contact: maliit-discuss@lists.maliit.org
7
 
 *
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
12
 
 * of this file.
13
 
 */
14
 
 
15
 
#include "ut_mimrotationanimation.h"
16
 
 
17
 
#include "mimxapplication.h"
18
 
#include "mimrotationanimation.h"
19
 
 
20
 
#include "gui-utils.h"
21
 
 
22
 
namespace {
23
 
    const QSize windowSize(200, 200);
24
 
}
25
 
 
26
 
void Ut_MImRotationAnimation::initTestCase()
27
 
{
28
 
    static char *argv[1] = { (char *) "Ut_MImRotationAnimation" };
29
 
    static int argc = 1;
30
 
 
31
 
    // Enforcing raster GS to make test reliable:
32
 
    QApplication::setGraphicsSystem("raster");
33
 
 
34
 
    app = new MImXApplication(argc, argv, xOptions);
35
 
 
36
 
    remote = new MaliitTestUtils::RemoteWindow;
37
 
    remote->setGeometry(0, 0, windowSize.width(), windowSize.height());
38
 
 
39
 
    remote->show();
40
 
    QTest::qWaitForWindowShown(remote->window());
41
 
}
42
 
 
43
 
void Ut_MImRotationAnimation::cleanupTestCase()
44
 
{
45
 
    delete remote;
46
 
    delete app;
47
 
}
48
 
 
49
 
void Ut_MImRotationAnimation::testPassthruHiddenDuringRotation()
50
 
{
51
 
    QSKIP("Unreliable on Device", SkipAll);
52
 
 
53
 
    MImXServerLogic *serverLogic = app->serverLogic();
54
 
 
55
 
    MImRotationAnimation subject(serverLogic->passThruWindow(), 0, serverLogic, xOptions);
56
 
    serverLogic->applicationFocusChanged(remote->window()->effectiveWinId());
57
 
 
58
 
    subject.appOrientationChangeFinished(0);
59
 
 
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());
64
 
 
65
 
    QMetaObject::invokeMethod(serverLogic->passThruWindow(), "inputPassthrough", Qt::DirectConnection,
66
 
                              Q_ARG(QRegion, QRegion()));
67
 
    subject.appOrientationChangeFinished(270);
68
 
    QVERIFY(!subject.isVisible());
69
 
}
70
 
 
71
 
QTEST_APPLESS_MAIN(Ut_MImRotationAnimation);