~ubuntu-branches/ubuntu/vivid/qtdeclarative-opensource-src-gles/vivid

« back to all changes in this revision

Viewing changes to tests/auto/quick/qquickflickable/tst_qquickflickable.cpp

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2015-03-11 16:51:45 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20150311165145-7653iqap3mau92gy
Tags: 5.4.1-0ubuntu1
Sync package with qtdeclarative-opensource-src - 5.4.1-1ubuntu3

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
    void stopAtBounds_data();
92
92
    void nestedMouseAreaUsingTouch();
93
93
    void pressDelayWithLoader();
 
94
    void cleanup();
94
95
 
95
96
private:
96
97
    void flickWithTouch(QQuickWindow *window, QTouchDevice *touchDevice, const QPoint &from, const QPoint &to);
97
 
    QQmlEngine engine;
98
98
};
99
99
 
 
100
void tst_qquickflickable::cleanup()
 
101
{
 
102
    QVERIFY(QGuiApplication::topLevelWindows().isEmpty());
 
103
}
 
104
 
100
105
void tst_qquickflickable::create()
101
106
{
102
107
    QQmlEngine engine;
199
204
 
200
205
void tst_qquickflickable::boundsBehavior()
201
206
{
 
207
    QQmlEngine engine;
202
208
    QQmlComponent component(&engine);
203
209
    component.setData("import QtQuick 2.0; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile(""));
204
210
    QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
330
336
 
331
337
void tst_qquickflickable::maximumFlickVelocity()
332
338
{
 
339
    QQmlEngine engine;
333
340
    QQmlComponent component(&engine);
334
341
    component.setData("import QtQuick 2.0; Flickable { maximumFlickVelocity: 1.0; }", QUrl::fromLocalFile(""));
335
342
    QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
349
356
 
350
357
void tst_qquickflickable::flickDeceleration()
351
358
{
 
359
    QQmlEngine engine;
352
360
    QQmlComponent component(&engine);
353
361
    component.setData("import QtQuick 2.0; Flickable { flickDeceleration: 1.0; }", QUrl::fromLocalFile(""));
354
362
    QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
553
561
 
554
562
void tst_qquickflickable::flickableDirection()
555
563
{
 
564
    QQmlEngine engine;
556
565
    QQmlComponent component(&engine);
557
566
    component.setData("import QtQuick 2.0; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile(""));
558
567
    QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
1213
1222
 
1214
1223
void tst_qquickflickable::margins()
1215
1224
{
1216
 
    QQmlEngine engine;
1217
 
    QQmlComponent c(&engine, testFileUrl("margins.qml"));
1218
 
    QQuickItem *root = qobject_cast<QQuickItem*>(c.create());
 
1225
    QScopedPointer<QQuickView> window(new QQuickView);
 
1226
    window->setSource(testFileUrl("margins.qml"));
 
1227
    QTRY_COMPARE(window->status(), QQuickView::Ready);
 
1228
    QQuickViewTestUtil::centerOnScreen(window.data());
 
1229
    QQuickViewTestUtil::moveMouseAway(window.data());
 
1230
    window->setTitle(QTest::currentTestFunction());
 
1231
    window->show();
 
1232
    QVERIFY(QTest::qWaitForWindowExposed(window.data()));
 
1233
    QQuickItem *root = window->rootObject();
 
1234
    QVERIFY(root);
1219
1235
    QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(root);
1220
1236
    QVERIFY(obj != 0);
1221
1237