@@ -511,5 +511,53 @@ Item {
511511 var lockscreen = findChild(shell, "lockscreen");
512512 verify(lockscreen.shown);
513513 }
514+
515+ /*
516+ Regression test for https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1393447
517+
518+ Do a left edge drag that is long enough to start displacing the greeter
519+ but short engough so that the greeter comes back into place once the
520+ finger is lifted.
521+
522+ In this situation the launcher should remaing fully shown and hide itself
523+ only after its idle timeout is triggered.
524+ */
525+ function test_shortLeftEdgeSwipeMakesLauncherStayVisible() {
526+ var greeter = testCase.findChild(shell, "greeter")
527+ greeter.show();
528+ tryCompare(greeter, "showProgress", 1);
529+
530+ var launcher = testCase.findChild(shell, "launcher")
531+ {
532+ var dismissTimer = testCase.findInvisibleChild(launcher, "dismissTimer");
533+ // effectively disable the dismiss timer
534+ dismissTimer.interval = 24 * 60 * 60 * 1000 // 24 hours
535+ }
536+ var launcherPanel = testCase.findChild(launcher, "launcherPanel");
537+
538+ var toX = shell.width * 0.45;
539+ touchFlick(shell,
540+ 1 /* fromX */, shell.height * 0.5 /* fromY */,
541+ toX /* toX */, shell.height * 0.5 /* toY */,
542+ true /* beginTouch */, false /* endTouch */,
543+ 50, 100);
544+
545+ // Launcher must be fully shown by now
546+ tryCompare(launcherPanel, "x", 0);
547+
548+ // Greeter should be displaced
549+ tryCompareFunction(function() { return greeter.mapToItem(shell, 0, 0).x > shell.width*0.2; }, true);
550+
551+ touchRelease(shell, toX, shell.height * 0.5);
552+
553+ // Upon release the greeter should have slid back into full view
554+ tryCompareFunction(function() { return greeter.mapToItem(shell, 0, 0).x === 0; }, true);
555+
556+ // And the launcher should stay fully shown
557+ for (var i = 0; i < 10; ++i) {
558+ wait(50);
559+ compare(launcherPanel.x, 0);
560+ }
561+ }
514562 }
515563}