@@ -213,6 +213,59 @@ Item {
213213 tryCompare(dash, "visible", false);
214214 }
215215
216+ /*
217+ Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
218+
219+ When the user minimizes an application (left-edge swipe) he should always end up in the "Running Apps"
220+ category of the "Applications" scope view.
221+
222+ Steps:
223+ - go to apps lens
224+ - scroll to the bottom
225+ - reveal launcher and launch an app
226+ - perform long left edge swipe to go minimize the app and go back to the dash.
227+
228+ Expected Results
229+ - apps lens shown and Running Apps visible on screen
230+ */
231+ function test_minimizingAppTakesToRunningApps() {
232+ var dashApps = findChild(shell, "DashApps");
233+
234+ swipeUntilScopeViewIsReached(dashApps);
235+
236+ // swipe finger up until the running/recent apps section (which we assume
237+ // it's the first one) is as far from view as possible.
238+ var appsCategoryListView = findChild(dashApps, "categoryListView");
239+ while (!appsCategoryListView.atYEnd) {
240+ swipeUpFromCenter();
241+ tryCompare(appsCategoryListView, "moving", false);
242+ }
243+
244+ // Switch away from the Applications scope.
245+ swipeRightFromCenter();
246+ waitUntilItemStopsMoving(dashApps);
247+ verify(!itemIsOnScreen(dashApps));
248+
249+ dragLauncherIntoView();
250+
251+ // Launch an app from the launcher
252+ tapOnAppIconInLauncher();
253+
254+ waitUntilApplicationWindowIsFullyVisible();
255+
256+ // Minimize the application we just launched
257+ swipeFromLeftEdge();
258+
259+ // Wait for the whole UI to settle down
260+ waitUntilApplicationWindowIsFullyHidden();
261+ waitUntilItemStopsMoving(dashApps);
262+ tryCompare(appsCategoryListView, "moving", false);
263+
264+ verify(itemIsOnScreen(dashApps));
265+ var runningApplicationsGrid = findChild(dashApps, "runningApplicationsGrid");
266+ verify(itemIsOnScreen(runningApplicationsGrid));
267+ }
268+
216269 // Wait for the whole UI to settle down
217270 function waitForUIToSettle() {
218271 waitUntilApplicationWindowIsFullyHidden();