on xenial help sign in
fix shell tests
commit3abbbd7e66ca556f291205ddeefcd5d9d6d3051e authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 15 Apr 2015, 16:32 (12 years ago) parent0693fb0
3 files changed+15−10
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+1 tests/qmltests/tst_Shell.qml+13−9 tests/utils/modules/Unity/Test/UnityTestCase.qml+1−1
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+1
@@ -193,6 +193,7 @@ void DirectionalDragArea::removeTimeConstraints()
193193{
194194 d->setMaxTime(60 * 60 * 1000);
195195 d->compositionTime = 0;
196+ ddaDebug("removed time constraints");
196197}
197198
198199bool DirectionalDragArea::event(QEvent *event)
tests/qmltests/tst_Shell.qml+13−9
@@ -373,11 +373,11 @@ Rectangle {
373373 function test_phoneLeftEdgeDrag_data() {
374374 return [
375375 {tag: "without launcher",
376− revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
376+ revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
377377 launcherHides: true, greeterShown: false},
378378
379379 {tag: "with launcher",
380− revealLauncher: true, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
380+ revealLauncher: true, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
381381 launcherHides: true, greeterShown: false},
382382
383383 {tag: "small swipe",
@@ -385,7 +385,7 @@ Rectangle {
385385 launcherHides: false, greeterShown: false},
386386
387387 {tag: "long swipe",
388− revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
388+ revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
389389 launcherHides: true, greeterShown: false},
390390
391391 {tag: "small swipe with greeter",
@@ -393,11 +393,11 @@ Rectangle {
393393 launcherHides: false, greeterShown: true},
394394
395395 {tag: "long swipe with greeter",
396− revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "dialer-app",
396+ revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "dialer-app",
397397 launcherHides: true, greeterShown: true},
398398
399399 {tag: "swipe over dash",
400− revealLauncher: false, swipeLength: units.gu(27), appHides: true, focusedApp: "unity8-dash",
400+ revealLauncher: false, swipeLength: units.gu(30), appHides: true, focusedApp: "unity8-dash",
401401 launcherHides: false, greeterShown: false},
402402 ];
403403 }
@@ -602,7 +602,7 @@ Rectangle {
602602
603603 dashCommunicatorSpy.clear();
604604 // Minimize the application we just launched
605− swipeFromLeftEdge(units.gu(27));
605+ swipeFromLeftEdge(shell.width * 0.75);
606606
607607 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
608608
@@ -724,7 +724,8 @@ Rectangle {
724724 }
725725
726726 function dragLauncherIntoView() {
727− var launcherPanel = findChild(shell, "launcherPanel");
727+ var launcher = findChild(shell, "launcher");
728+ var launcherPanel = findChild(launcher, "launcherPanel");
728729 verify(launcherPanel.x = - launcherPanel.width);
729730
730731 var touchStartX = 2;
@@ -732,6 +733,7 @@ Rectangle {
732733 touchFlick(shell, touchStartX, touchStartY, launcherPanel.width + units.gu(1), touchStartY);
733734
734735 tryCompare(launcherPanel, "x", 0);
736+ tryCompare(launcher, "state", "visible");
735737 }
736738
737739 function tapOnAppIconInLauncher() {
@@ -768,7 +770,9 @@ Rectangle {
768770 function swipeFromLeftEdge(swipeLength) {
769771 var touchStartX = 2;
770772 var touchStartY = shell.height / 2;
771− touchFlick(shell, touchStartX, touchStartY, swipeLength, touchStartY);
773+ touchFlick(shell,
774+ touchStartX , touchStartY,
775+ touchStartX + swipeLength, touchStartY);
772776 }
773777
774778 function itemIsOnScreen(item) {
@@ -835,7 +839,7 @@ Rectangle {
835839 tryCompareFunction(function() { return app.session !== null && app.session.surface !== null }, true);
836840
837841 // Minimize the application we just launched
838− swipeFromLeftEdge(units.gu(26) + 1);
842+ swipeFromLeftEdge(shell.width * 0.75);
839843
840844 waitUntilDashIsFocused();
841845
tests/utils/modules/Unity/Test/UnityTestCase.qml+1−1
@@ -269,7 +269,7 @@ TestCase {
269269 speed = (speed !== undefined) ? speed : units.gu(10)
270270
271271 // Set a default iterations if not specified
272− var iterations = (iterations !== undefined) ? iterations : 5
272+ var iterations = (iterations !== undefined) ? iterations : 10
273273
274274 var distance = Math.sqrt(Math.pow(rootTo.x - rootFrom.x, 2) + Math.pow(rootTo.Y - rootFrom.y, 2))
275275 var totalTime = (distance / speed) * 1000 /* converting speed to pixels/ms */