on xenial help sign in
update some tests, still not completely working
29cb42eMichael Zanetti
qml/Stages/DesktopSpread.qml+1
@@ -84,6 +84,7 @@ FocusScope {
84
84
85 Repeater {
85 Repeater {
86 id: spreadRepeater
86 id: spreadRepeater
87+ objectName: "spreadRepeater"
87 model: ApplicationManager
88 model: ApplicationManager
88
89
89 property int highlightedIndex: -1
90 property int highlightedIndex: -1
qml/Stages/DesktopStage.qml+1
@@ -269,6 +269,7 @@ Rectangle {
269
269
270 DesktopSpread {
270 DesktopSpread {
271 id: spread
271 id: spread
272+ objectName: "spread"
272 anchors.fill: parent
273 anchors.fill: parent
273 workspace: appContainer
274 workspace: appContainer
274 focus: state == "altTab"
275 focus: state == "altTab"
tests/mocks/Unity/Application/MirSurface.cpp+5−5
@@ -36,12 +36,12 @@ MirSurface::MirSurface(const QString& name,
36 , m_width(-1)
36 , m_width(-1)
37 , m_height(-1)
37 , m_height(-1)
38{
38{
39− qDebug() << "MirSurface::MirSurface() " << name;
39+// qDebug() << "MirSurface::MirSurface() " << name;
40}
40}
41
41
42MirSurface::~MirSurface()
42MirSurface::~MirSurface()
43{
43{
44− qDebug() << "MirSurface::~MirSurface() " << name();
44+// qDebug() << "MirSurface::~MirSurface() " << name();
45}
45}
46
46
47QString MirSurface::name() const
47QString MirSurface::name() const
@@ -75,7 +75,7 @@ bool MirSurface::live() const
75
75
76void MirSurface::setLive(bool live)
76void MirSurface::setLive(bool live)
77{
77{
78− qDebug().nospace() << "MirSurface::setLive("<<live<<") " << name();
78+// qDebug().nospace() << "MirSurface::setLive("<<live<<") " << name();
79 if (live == m_live)
79 if (live == m_live)
80 return;
80 return;
81
81
@@ -123,13 +123,13 @@ void MirSurface::setOrientationAngle(Mir::OrientationAngle angle)
123void MirSurface::incrementViewCount()
123void MirSurface::incrementViewCount()
124{
124{
125 ++m_viewCount;
125 ++m_viewCount;
126− qDebug().nospace() << "MirSurface::incrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
126+// qDebug().nospace() << "MirSurface::incrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
127}
127}
128
128
129void MirSurface::decrementViewCount()
129void MirSurface::decrementViewCount()
130{
130{
131 --m_viewCount;
131 --m_viewCount;
132− qDebug().nospace() << "MirSurface::decrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
132+// qDebug().nospace() << "MirSurface::decrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
133
133
134 Q_ASSERT(m_viewCount >= 0);
134 Q_ASSERT(m_viewCount >= 0);
135
135
tests/mocks/Unity/Application/MirSurfaceItem.cpp+6−6
@@ -38,7 +38,7 @@ MirSurfaceItem::MirSurfaceItem(QQuickItem *parent)
38 , m_touchPressCount(0)
38 , m_touchPressCount(0)
39 , m_touchReleaseCount(0)
39 , m_touchReleaseCount(0)
40{
40{
41− qDebug() << "MirSurfaceItem::MirSurfaceItem() " << (void*)(this) << name();
41+// qDebug() << "MirSurfaceItem::MirSurfaceItem() " << (void*)(this) << name();
42 setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton |
42 setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton |
43 Qt::ExtraButton1 | Qt::ExtraButton2 | Qt::ExtraButton3 | Qt::ExtraButton4 |
43 Qt::ExtraButton1 | Qt::ExtraButton2 | Qt::ExtraButton3 | Qt::ExtraButton4 |
44 Qt::ExtraButton5 | Qt::ExtraButton6 | Qt::ExtraButton7 | Qt::ExtraButton8 |
44 Qt::ExtraButton5 | Qt::ExtraButton6 | Qt::ExtraButton7 | Qt::ExtraButton8 |
@@ -48,7 +48,7 @@ MirSurfaceItem::MirSurfaceItem(QQuickItem *parent)
48
48
49MirSurfaceItem::~MirSurfaceItem()
49MirSurfaceItem::~MirSurfaceItem()
50{
50{
51− qDebug() << "MirSurfaceItem::~MirSurfaceItem() " << (void*)(this) << name();
51+// qDebug() << "MirSurfaceItem::~MirSurfaceItem() " << (void*)(this) << name();
52 setSurface(nullptr);
52 setSurface(nullptr);
53}
53}
54
54
@@ -136,7 +136,7 @@ void MirSurfaceItem::onComponentStatusChanged(QQmlComponent::Status status)
136
136
137void MirSurfaceItem::createQmlContentItem()
137void MirSurfaceItem::createQmlContentItem()
138{
138{
139− qDebug() << "MirSurfaceItem::createQmlContentItem()";
139+// qDebug() << "MirSurfaceItem::createQmlContentItem()";
140
140
141 m_qmlItem = qobject_cast<QQuickItem*>(m_qmlContentComponent->create());
141 m_qmlItem = qobject_cast<QQuickItem*>(m_qmlContentComponent->create());
142 m_qmlItem->setParentItem(this);
142 m_qmlItem->setParentItem(this);
@@ -178,9 +178,9 @@ void MirSurfaceItem::mouseReleaseEvent(QMouseEvent * event)
178
178
179void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
179void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
180{
180{
181− qDebug().nospace() << "MirSurfaceItem::setSurface() this=" << (void*)(this)
181+// qDebug().nospace() << "MirSurfaceItem::setSurface() this=" << (void*)(this)
182− << " name=" << name()
182+// << " name=" << name()
183− << " surface=" << surface;
183+// << " surface=" << surface;
184
184
185 if (m_qmlSurface == surface) {
185 if (m_qmlSurface == surface) {
186 return;
186 return;
tests/qmltests/tst_Shell.qml+11−8
@@ -1574,18 +1574,21 @@ Rectangle {
1574 function test_selectFromSpreadWithMouse(data) {
1574 function test_selectFromSpreadWithMouse(data) {
1575 loadDesktopShellWithApps()
1575 loadDesktopShellWithApps()
1576
1576
1577+ var stage = findChild(shell, "stage");
1578+ var spread = findChild(stage, "spread");
1579+ waitForRendering(spread)
1580+
1577− var appRepeater = findInvisibleChild(shell, "appRepeater");
1581+ var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1578− verify(appRepeater !== null);
1582+ verify(spreadRepeater !== null);
1579
1583
1580 keyPress(Qt.Key_Control)
1584 keyPress(Qt.Key_Control)
1581 keyClick(Qt.Key_Tab);
1585 keyClick(Qt.Key_Tab);
1582
1586
1583 var focusAppId = ApplicationManager.get(2).appId;
1587 var focusAppId = ApplicationManager.get(2).appId;
1584− var appDelegate2 = appRepeater.itemAt(2);
1588+ var spreadDelegate2 = spreadRepeater.itemAt(2);
1585− var decoratedWindow = findChild(appDelegate2, "decoratedWindow");
1589+ var clippedSpreadDelegate = findChild(spreadDelegate2, "clippedSpreadDelegate");
1586− var stage = findChild(shell, "stage");
1587
1590
1588− tryCompare(stage, "state", "altTab");
1591+ tryCompare(spread, "state", "altTab");
1589
1592
1590 // Move the mouse over tile 2 and verify the highlight becomes visible
1593 // Move the mouse over tile 2 and verify the highlight becomes visible
1591 var x = 0;
1594 var x = 0;
@@ -1596,10 +1599,10 @@ Rectangle {
1596 mouseMove(shell, x, y)
1599 mouseMove(shell, x, y)
1597 wait(0); // spin the loop so bindings get evaluated
1600 wait(0); // spin the loop so bindings get evaluated
1598 }
1601 }
1599− tryCompare(decoratedWindow, "highlightShown", true);
1602+ tryCompare(clippedSpreadDelegate, "highlightShown", true);
1600
1603
1601 // Click the tile
1604 // Click the tile
1602− mouseClick(decoratedWindow, decoratedWindow.width / 2, decoratedWindow.height / 2)
1605+ mouseClick(clippedSpreadDelegate, clippedSpreadDelegate.width / 2, clippedSpreadDelegate.height / 2)
1603
1606
1604 // Verify that we left the spread and app2 is the focused one now
1607 // Verify that we left the spread and app2 is the focused one now
1605 tryCompare(stage, "state", "");
1608 tryCompare(stage, "state", "");