on xenial help sign in
Workaround compiz/unity7 behaviour change/bug

commit776611a1e7746fa5f1de4577d3a1bd2bbf58e2d0 authorAlbert Astals <albert.astals@canonical.com> dateFri 14 Mar 2014, 15:45 (13 years ago) parentf0f522c66faee7
3 files changed+12−2
tests/plugins/DashViews/organicgridtest.cpp+2−1 tests/plugins/DashViews/verticaljournaltest.cpp+2−1 tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp+8
tests/plugins/DashViews/organicgridtest.cpp+2−1
@@ -134,11 +134,12 @@ private Q_SLOTS:
134134 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/organicgridtest.qml"));
135135
136136 view->show();
137− view->resize(470, 400);
138137 QTest::qWaitForWindowExposed(view);
138+ view->resize(470, 400);
139139
140140 grid = dynamic_cast<OrganicGrid*>(view->rootObject()->findChild<QObject*>("grid"));
141141 grid->setModel(model);
142+ QTRY_COMPARE(grid->width(), 470.);
142143
143144 checkInitialPositions();
144145 }
tests/plugins/DashViews/verticaljournaltest.cpp+2−1
@@ -135,11 +135,12 @@ private Q_SLOTS:
135135 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/verticaljournaltest.qml"));
136136
137137 view->show();
138− view->resize(470, 400);
139138 QTest::qWaitForWindowExposed(view);
139+ view->resize(470, 400);
140140
141141 vj = dynamic_cast<VerticalJournal*>(view->rootObject()->findChild<QObject*>("vj"));
142142 vj->setModel(model);
143+ QTRY_COMPARE(vj->width(), 470.);
143144
144145 checkInitialPositions();
145146 }
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp+8
@@ -103,6 +103,14 @@ void tst_DirectionalDragArea::init()
103103{
104104 GestureTest::init();
105105
106+ // We shouldn't need the three lines below, but a compiz/unity7
107+ // regression means we don't pass the test without them because
108+ // the window doesn't have the proper size. Can be removed in the
109+ // future if the regression is fixed and tests pass again
110+ m_view->resize(m_view->rootObject()->width(), m_view->rootObject()->height());
111+ QTRY_COMPARE(m_view->width(), (int)m_view->rootObject()->width());
112+ QTRY_COMPARE(m_view->height(), (int)m_view->rootObject()->height());
113+
106114 fakeTimeSource.reset(new FakeTimeSource);
107115 fakeTimer = new FakeTimer(fakeTimeSource);
108116}