on xenial help sign in
fix shell tests
3abbbd7Daniel d'Andrada
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp+1
@@ -193,6 +193,7 @@ void DirectionalDragArea::removeTimeConstraints()
193{
193{
194 d->setMaxTime(60 * 60 * 1000);
194 d->setMaxTime(60 * 60 * 1000);
195 d->compositionTime = 0;
195 d->compositionTime = 0;
196+ ddaDebug("removed time constraints");
196}
197}
197
198
198bool DirectionalDragArea::event(QEvent *event)
199bool DirectionalDragArea::event(QEvent *event)
tests/qmltests/tst_Shell.qml+13−9
@@ -373,11 +373,11 @@ Rectangle {
373 function test_phoneLeftEdgeDrag_data() {
373 function test_phoneLeftEdgeDrag_data() {
374 return [
374 return [
375 {tag: "without launcher",
375 {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",
377 launcherHides: true, greeterShown: false},
377 launcherHides: true, greeterShown: false},
378
378
379 {tag: "with launcher",
379 {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",
381 launcherHides: true, greeterShown: false},
381 launcherHides: true, greeterShown: false},
382
382
383 {tag: "small swipe",
383 {tag: "small swipe",
@@ -385,7 +385,7 @@ Rectangle {
385 launcherHides: false, greeterShown: false},
385 launcherHides: false, greeterShown: false},
386
386
387 {tag: "long swipe",
387 {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",
389 launcherHides: true, greeterShown: false},
389 launcherHides: true, greeterShown: false},
390
390
391 {tag: "small swipe with greeter",
391 {tag: "small swipe with greeter",
@@ -393,11 +393,11 @@ Rectangle {
393 launcherHides: false, greeterShown: true},
393 launcherHides: false, greeterShown: true},
394
394
395 {tag: "long swipe with greeter",
395 {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",
397 launcherHides: true, greeterShown: true},
397 launcherHides: true, greeterShown: true},
398
398
399 {tag: "swipe over dash",
399 {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",
401 launcherHides: false, greeterShown: false},
401 launcherHides: false, greeterShown: false},
402 ];
402 ];
403 }
403 }
@@ -602,7 +602,7 @@ Rectangle {
602
602
603 dashCommunicatorSpy.clear();
603 dashCommunicatorSpy.clear();
604 // Minimize the application we just launched
604 // Minimize the application we just launched
605− swipeFromLeftEdge(units.gu(27));
605+ swipeFromLeftEdge(shell.width * 0.75);
606
606
607 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
607 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
608
608
@@ -724,7 +724,8 @@ Rectangle {
724 }
724 }
725
725
726 function dragLauncherIntoView() {
726 function dragLauncherIntoView() {
727− var launcherPanel = findChild(shell, "launcherPanel");
727+ var launcher = findChild(shell, "launcher");
728+ var launcherPanel = findChild(launcher, "launcherPanel");
728 verify(launcherPanel.x = - launcherPanel.width);
729 verify(launcherPanel.x = - launcherPanel.width);
729
730
730 var touchStartX = 2;
731 var touchStartX = 2;
@@ -732,6 +733,7 @@ Rectangle {
732 touchFlick(shell, touchStartX, touchStartY, launcherPanel.width + units.gu(1), touchStartY);
733 touchFlick(shell, touchStartX, touchStartY, launcherPanel.width + units.gu(1), touchStartY);
733
734
734 tryCompare(launcherPanel, "x", 0);
735 tryCompare(launcherPanel, "x", 0);
736+ tryCompare(launcher, "state", "visible");
735 }
737 }
736
738
737 function tapOnAppIconInLauncher() {
739 function tapOnAppIconInLauncher() {
@@ -768,7 +770,9 @@ Rectangle {
768 function swipeFromLeftEdge(swipeLength) {
770 function swipeFromLeftEdge(swipeLength) {
769 var touchStartX = 2;
771 var touchStartX = 2;
770 var touchStartY = shell.height / 2;
772 var touchStartY = shell.height / 2;
773+ touchFlick(shell,
771− touchFlick(shell, touchStartX, touchStartY, swipeLength, touchStartY);
774+ touchStartX , touchStartY,
775+ touchStartX + swipeLength, touchStartY);
772 }
776 }
773
777
774 function itemIsOnScreen(item) {
778 function itemIsOnScreen(item) {
@@ -835,7 +839,7 @@ Rectangle {
835 tryCompareFunction(function() { return app.session !== null && app.session.surface !== null }, true);
839 tryCompareFunction(function() { return app.session !== null && app.session.surface !== null }, true);
836
840
837 // Minimize the application we just launched
841 // Minimize the application we just launched
838− swipeFromLeftEdge(units.gu(26) + 1);
842+ swipeFromLeftEdge(shell.width * 0.75);
839
843
840 waitUntilDashIsFocused();
844 waitUntilDashIsFocused();
841
845
tests/utils/modules/Unity/Test/UnityTestCase.qml+1−1
@@ -269,7 +269,7 @@ TestCase {
269 speed = (speed !== undefined) ? speed : units.gu(10)
269 speed = (speed !== undefined) ? speed : units.gu(10)
270
270
271 // Set a default iterations if not specified
271 // Set a default iterations if not specified
272− var iterations = (iterations !== undefined) ? iterations : 5
272+ var iterations = (iterations !== undefined) ? iterations : 10
273
273
274 var distance = Math.sqrt(Math.pow(rootTo.x - rootFrom.x, 2) + Math.pow(rootTo.Y - rootFrom.y, 2))
274 var distance = Math.sqrt(Math.pow(rootTo.x - rootFrom.x, 2) + Math.pow(rootTo.Y - rootFrom.y, 2))
275 var totalTime = (distance / speed) * 1000 /* converting speed to pixels/ms */
275 var totalTime = (distance / speed) * 1000 /* converting speed to pixels/ms */