@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013,2014 Canonical, Ltd.
2+ * Copyright (C) 2013,2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -319,6 +319,36 @@ Item {
319319 tryCompare(left, "shown", true); // and we should still be on left
320320 }
321321
322+ function test_launcherNoDragGap() {
323+ // See bug 1454882, where if you dragged the launcher while it was
324+ // visible, you could pull it further than the edge of the screen.
325+
326+ var left = goToPage("tutorialLeft");
327+ var launcher = findChild(shell, "launcher");
328+ var teaseAnimation = findInvisibleChild(left, "teaseAnimation");
329+
330+ // Wait for launcher to be really out there
331+ tryCompareFunction(function() {return launcher.x > teaseAnimation.maxBounce/2}, true);
332+ verify(teaseAnimation.running);
333+
334+ // Start a drag, make sure animation stops
335+ touchFlick(shell, 0, halfHeight, units.gu(3), halfHeight, true, false);
336+ verify(!teaseAnimation.running);
337+ verify(launcher.visibleWidth > 0);
338+ verify(launcher.x > 0);
339+ compare(launcher.x, teaseAnimation.bounce);
340+
341+ // Continue drag, make sure we don't create a gap on the left hand side
342+ touchFlick(shell, units.gu(3), halfHeight, shell.width, halfHeight, false, false);
343+ verify(!teaseAnimation.running);
344+ compare(launcher.visibleWidth, launcher.panelWidth);
345+ compare(launcher.x, 0);
346+
347+ // Finish and make sure we continue animation
348+ touchFlick(shell, shell.width, halfHeight, shell.width, halfHeight, false, true);
349+ tryCompare(teaseAnimation, "running", true);
350+ }
351+
322352 function test_spread() {
323353 // Unfortunately, most of what we want to test of the spread is
324354 // "did it render correctly?" but that's hard to test. So instead,