@@ -43,6 +43,11 @@ StyledItem {
4343
4444 lockedVisible: lockedVisibleCheckBox.checked
4545
46+ property string lastSelectedApplication
47+ onLauncherApplicationSelected: {
48+ lastSelectedApplication = appId
49+ }
50+
4651 Component.onCompleted: {
4752 launcher.focus = true
4853 edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController");
@@ -105,18 +110,24 @@ StyledItem {
105110
106111 function revealByEdgePush() {
107112 // Place the mouse against the window/screen edge and push beyond the barrier threshold
113+ // If the mouse did not move between two revealByEdgePush(), we need it to move out the
114+ // area to make sure we're not just accumulating to the previous push
115+ mouseMove(root, root.width, root.height / 2);
108116 mouseMove(root, 1, root.height / 2);
117+
109118 launcher.pushEdge(EdgeBarrierSettings.pushThreshold * 1.1);
110119
111− var panel = findChild(launcher, "launcherPanel");
112− verify(!!panel);
120+ var drawer = findChild(launcher, "drawer");
121+ verify(!!drawer);
113122
114123 // wait until it gets fully extended
115− tryCompare(panel, "x", 0);
124+ tryCompare(drawer, "x", 0);
116125 tryCompare(launcher, "state", "drawer");
117126 }
118127
119128 function init() {
129+ launcher.lastSelectedApplication = "";
130+ launcher.lockedVisible = false;
120131 launcher.hide();
121132 var drawer = findChild(launcher, "drawer");
122133 tryCompare(drawer, "x", -drawer.width);
@@ -126,8 +137,54 @@ StyledItem {
126137 dragDrawerIntoView();
127138 }
128139
129− function test_revealByEdgePush() {
140+ function test_revealByEdgePush_data() {
141+ return [
142+ { tag: "autohide launcher", autohide: true },
143+ { tag: "locked launcher", autohide: false }
144+ ]
145+ }
146+
147+ function test_revealByEdgePush(data) {
148+ launcher.lockedVisible = !data.autohide;
149+
150+ var panel = findChild(launcher, "launcherPanel");
151+ tryCompare(panel, "x", data.autohide ? -panel.width : 0);
152+ tryCompare(launcher, "state", data.autohide ? "" : "visible");
153+ waitForRendering(launcher)
154+
130155 revealByEdgePush();
131156 }
157+
158+ function test_hideByDraggingDrawer() {
159+ dragDrawerIntoView();
160+
161+ var drawer = findChild(launcher, "drawer");
162+
163+ mouseFlick(drawer, drawer.width - units.gu(1), drawer.height / 2, drawer.width - units.gu(12), drawer.height / 2);
164+
165+ tryCompare(launcher, "state", "");
166+ }
167+
168+ function test_hideByClickingOutside() {
169+ dragDrawerIntoView();
170+
171+ var drawer = findChild(launcher, "drawer");
172+
173+ mouseClick(root, drawer.width + units.gu(1), root.height / 2);
174+
175+ tryCompare(launcher, "state", "");
176+ }
177+
178+ function test_launchAppFromDrawer() {
179+ dragDrawerIntoView();
180+
181+ var drawerList = findChild(launcher, "drawerItemList");
182+ var dialerApp = findChild(drawerList, "drawerItem_dialer-app");
183+ mouseClick(dialerApp, dialerApp.width / 2, dialerApp.height / 2);
184+
185+ tryCompare(launcher, "lastSelectedApplication", "dialer-app");
186+
187+ tryCompare(launcher, "state", "");
188+ }
132189 }
133190}