on xenial help sign in
add a qml test
2adb51chandsome_feng
qml/Launcher/Launcher.qml+1
@@ -180,6 +180,7 @@ Item {
180
180
181 //We need to eat touch events here because of bug lp:1445472
181 //We need to eat touch events here because of bug lp:1445472
182 MultiPointTouchArea {
182 MultiPointTouchArea {
183+ objectName: "eatTouchArea"
183 anchors.fill: parent
184 anchors.fill: parent
184 enabled: root.shadeBackground && root.state == "visible"
185 enabled: root.shadeBackground && root.state == "visible"
185 }
186 }
tests/qmltests/Launcher/tst_Launcher.qml+27
@@ -201,6 +201,33 @@ Item {
201 tryCompare(panel, "x", -launcher.panelWidth, 1000)
201 tryCompare(panel, "x", -launcher.panelWidth, 1000)
202 }
202 }
203
203
204+ function test_cantClickOnDashWhileDraggingALauncherIcon() {
205+ dragLauncherIntoView();
206+ var eatTouchArea = findChild(launcher, "eatTouchArea")
207+ var draggedItem = findChild(launcher, "launcherDelegate4")
208+ var item0 = findChild(launcher, "launcherDelegate0")
209+ var fakeDragItem = findChild(launcher, "fakeDragItem")
210+
211+ // Doing longpress
212+ var currentMouseX = draggedItem.width / 2
213+ var currentMouseY = draggedItem.height / 2
214+ mousePress(draggedItem, currentMouseX, currentMouseY)
215+ // DraggedItem needs to hide and fakeDragItem become visible
216+ tryCompare(draggedItem, "itemOpacity", 0)
217+ tryCompare(fakeDragItem, "visible", true)
218+
219+ // Dragging
220+ currentMouseX -= units.gu(20)
221+ mouseMove(draggedItem, currentMouseX, currentMouseY)
222+
223+ // Make sure we're in the dragging state
224+ var dndArea = findChild(launcher, "dndArea");
225+ tryCompare(draggedItem, "dragging", true)
226+ tryCompare(dndArea, "draggedIndex", 4)
227+
228+ compare(eatTouchArea.enabled, true)
229+ }
230+
204 /* If I click on the icon of an application on the launcher
231 /* If I click on the icon of an application on the launcher
205 Launcher::launcherApplicationSelected signal should be emitted with the
232 Launcher::launcherApplicationSelected signal should be emitted with the
206 corresponding desktop file. E.g. clicking on phone icon should yield
233 corresponding desktop file. E.g. clicking on phone icon should yield