on xenial help sign in
Workaround compiz/unity7 behaviour change/bug
776611aAlbert Astals
tests/plugins/DashViews/organicgridtest.cpp+2−1
@@ -134,11 +134,12 @@ private Q_SLOTS:
134 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/organicgridtest.qml"));
134 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/organicgridtest.qml"));
135
135
136 view->show();
136 view->show();
137− view->resize(470, 400);
138 QTest::qWaitForWindowExposed(view);
137 QTest::qWaitForWindowExposed(view);
138+ view->resize(470, 400);
139
139
140 grid = dynamic_cast<OrganicGrid*>(view->rootObject()->findChild<QObject*>("grid"));
140 grid = dynamic_cast<OrganicGrid*>(view->rootObject()->findChild<QObject*>("grid"));
141 grid->setModel(model);
141 grid->setModel(model);
142+ QTRY_COMPARE(grid->width(), 470.);
142
143
143 checkInitialPositions();
144 checkInitialPositions();
144 }
145 }
tests/plugins/DashViews/verticaljournaltest.cpp+2−1
@@ -135,11 +135,12 @@ private Q_SLOTS:
135 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/verticaljournaltest.qml"));
135 view->setSource(QUrl::fromLocalFile(DASHVIEWSTEST_FOLDER "/verticaljournaltest.qml"));
136
136
137 view->show();
137 view->show();
138− view->resize(470, 400);
139 QTest::qWaitForWindowExposed(view);
138 QTest::qWaitForWindowExposed(view);
139+ view->resize(470, 400);
140
140
141 vj = dynamic_cast<VerticalJournal*>(view->rootObject()->findChild<QObject*>("vj"));
141 vj = dynamic_cast<VerticalJournal*>(view->rootObject()->findChild<QObject*>("vj"));
142 vj->setModel(model);
142 vj->setModel(model);
143+ QTRY_COMPARE(vj->width(), 470.);
143
144
144 checkInitialPositions();
145 checkInitialPositions();
145 }
146 }
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp+8
@@ -103,6 +103,14 @@ void tst_DirectionalDragArea::init()
103{
103{
104 GestureTest::init();
104 GestureTest::init();
105
105
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+
106 fakeTimeSource.reset(new FakeTimeSource);
114 fakeTimeSource.reset(new FakeTimeSource);
107 fakeTimer = new FakeTimer(fakeTimeSource);
115 fakeTimer = new FakeTimer(fakeTimeSource);
108}
116}