on xenial help sign in
update some tests, still not completely working
commit29cb42e0199f186195c55f7e77dc02f139ff9292 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 18 Sep 2015, 11:51 (11 years ago) parent9c8f0dd
5 files changed+24−19
qml/Stages/DesktopSpread.qml+1 qml/Stages/DesktopStage.qml+1 tests/mocks/Unity/Application/MirSurface.cpp+5−5 tests/mocks/Unity/Application/MirSurfaceItem.cpp+6−6 tests/qmltests/tst_Shell.qml+11−8
qml/Stages/DesktopSpread.qml+1
@@ -84,6 +84,7 @@ FocusScope {
8484
8585 Repeater {
8686 id: spreadRepeater
87+ objectName: "spreadRepeater"
8788 model: ApplicationManager
8889
8990 property int highlightedIndex: -1
qml/Stages/DesktopStage.qml+1
@@ -269,6 +269,7 @@ Rectangle {
269269
270270 DesktopSpread {
271271 id: spread
272+ objectName: "spread"
272273 anchors.fill: parent
273274 workspace: appContainer
274275 focus: state == "altTab"
tests/mocks/Unity/Application/MirSurface.cpp+5−5
@@ -36,12 +36,12 @@ MirSurface::MirSurface(const QString& name,
3636 , m_width(-1)
3737 , m_height(-1)
3838{
39− qDebug() << "MirSurface::MirSurface() " << name;
39+// qDebug() << "MirSurface::MirSurface() " << name;
4040}
4141
4242MirSurface::~MirSurface()
4343{
44− qDebug() << "MirSurface::~MirSurface() " << name();
44+// qDebug() << "MirSurface::~MirSurface() " << name();
4545}
4646
4747QString MirSurface::name() const
@@ -75,7 +75,7 @@ bool MirSurface::live() const
7575
7676void MirSurface::setLive(bool live)
7777{
78− qDebug().nospace() << "MirSurface::setLive("<<live<<") " << name();
78+// qDebug().nospace() << "MirSurface::setLive("<<live<<") " << name();
7979 if (live == m_live)
8080 return;
8181
@@ -123,13 +123,13 @@ void MirSurface::setOrientationAngle(Mir::OrientationAngle angle)
123123void MirSurface::incrementViewCount()
124124{
125125 ++m_viewCount;
126− qDebug().nospace() << "MirSurface::incrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
126+// qDebug().nospace() << "MirSurface::incrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
127127}
128128
129129void MirSurface::decrementViewCount()
130130{
131131 --m_viewCount;
132− qDebug().nospace() << "MirSurface::decrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
132+// qDebug().nospace() << "MirSurface::decrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
133133
134134 Q_ASSERT(m_viewCount >= 0);
135135
tests/mocks/Unity/Application/MirSurfaceItem.cpp+6−6
@@ -38,7 +38,7 @@ MirSurfaceItem::MirSurfaceItem(QQuickItem *parent)
3838 , m_touchPressCount(0)
3939 , m_touchReleaseCount(0)
4040{
41− qDebug() << "MirSurfaceItem::MirSurfaceItem() " << (void*)(this) << name();
41+// qDebug() << "MirSurfaceItem::MirSurfaceItem() " << (void*)(this) << name();
4242 setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton |
4343 Qt::ExtraButton1 | Qt::ExtraButton2 | Qt::ExtraButton3 | Qt::ExtraButton4 |
4444 Qt::ExtraButton5 | Qt::ExtraButton6 | Qt::ExtraButton7 | Qt::ExtraButton8 |
@@ -48,7 +48,7 @@ MirSurfaceItem::MirSurfaceItem(QQuickItem *parent)
4848
4949MirSurfaceItem::~MirSurfaceItem()
5050{
51− qDebug() << "MirSurfaceItem::~MirSurfaceItem() " << (void*)(this) << name();
51+// qDebug() << "MirSurfaceItem::~MirSurfaceItem() " << (void*)(this) << name();
5252 setSurface(nullptr);
5353}
5454
@@ -136,7 +136,7 @@ void MirSurfaceItem::onComponentStatusChanged(QQmlComponent::Status status)
136136
137137void MirSurfaceItem::createQmlContentItem()
138138{
139− qDebug() << "MirSurfaceItem::createQmlContentItem()";
139+// qDebug() << "MirSurfaceItem::createQmlContentItem()";
140140
141141 m_qmlItem = qobject_cast<QQuickItem*>(m_qmlContentComponent->create());
142142 m_qmlItem->setParentItem(this);
@@ -178,9 +178,9 @@ void MirSurfaceItem::mouseReleaseEvent(QMouseEvent * event)
178178
179179void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
180180{
181− qDebug().nospace() << "MirSurfaceItem::setSurface() this=" << (void*)(this)
182− << " name=" << name()
183− << " surface=" << surface;
181+// qDebug().nospace() << "MirSurfaceItem::setSurface() this=" << (void*)(this)
182+// << " name=" << name()
183+// << " surface=" << surface;
184184
185185 if (m_qmlSurface == surface) {
186186 return;
tests/qmltests/tst_Shell.qml+11−8
@@ -1574,18 +1574,21 @@ Rectangle {
15741574 function test_selectFromSpreadWithMouse(data) {
15751575 loadDesktopShellWithApps()
15761576
1577− var appRepeater = findInvisibleChild(shell, "appRepeater");
1578− verify(appRepeater !== null);
1577+ var stage = findChild(shell, "stage");
1578+ var spread = findChild(stage, "spread");
1579+ waitForRendering(spread)
1580+
1581+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1582+ verify(spreadRepeater !== null);
15791583
15801584 keyPress(Qt.Key_Control)
15811585 keyClick(Qt.Key_Tab);
15821586
15831587 var focusAppId = ApplicationManager.get(2).appId;
1584− var appDelegate2 = appRepeater.itemAt(2);
1585− var decoratedWindow = findChild(appDelegate2, "decoratedWindow");
1586− var stage = findChild(shell, "stage");
1588+ var spreadDelegate2 = spreadRepeater.itemAt(2);
1589+ var clippedSpreadDelegate = findChild(spreadDelegate2, "clippedSpreadDelegate");
15871590
1588− tryCompare(stage, "state", "altTab");
1591+ tryCompare(spread, "state", "altTab");
15891592
15901593 // Move the mouse over tile 2 and verify the highlight becomes visible
15911594 var x = 0;
@@ -1596,10 +1599,10 @@ Rectangle {
15961599 mouseMove(shell, x, y)
15971600 wait(0); // spin the loop so bindings get evaluated
15981601 }
1599− tryCompare(decoratedWindow, "highlightShown", true);
1602+ tryCompare(clippedSpreadDelegate, "highlightShown", true);
16001603
16011604 // Click the tile
1602− mouseClick(decoratedWindow, decoratedWindow.width / 2, decoratedWindow.height / 2)
1605+ mouseClick(clippedSpreadDelegate, clippedSpreadDelegate.width / 2, clippedSpreadDelegate.height / 2)
16031606
16041607 // Verify that we left the spread and app2 is the focused one now
16051608 tryCompare(stage, "state", "");