@@ -56,6 +56,18 @@ Item {
57 function initTestCase() {
57 function initTestCase() {
58 swipeAwayGreeter();
58 swipeAwayGreeter();
60+ // Ensure DashHome is loaded before continuing
61+ var dashContentList = findChild(shell, "dashContentList");
62+ waitForRendering(dashContentList);
63+ var homeLoader = findChild(dashContentList, "home.scope loader");
65+ tryCompareFunction(function() {return homeLoader.item !== undefined;}, true);
67+ // FIXME: Desperate measure to ensure Jenkins has the scene graph fully loaded
68+ // before it calls the test functions (otherwise findChild calls will fail).
69+ // The code above just didn't solve it.
61 function cleanup() {
73 function cleanup() {
@@ -213,6 +225,62 @@ Item {
213 tryCompare(dash, "visible", false);
225 tryCompare(dash, "visible", false);
229+ Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
231+ When the user minimizes an application (left-edge swipe) he should always end up in the "Running Apps"
232+ category of the "Applications" scope view.
236+ - scroll to the bottom
237+ - reveal launcher and launch an app
238+ - perform long left edge swipe to go minimize the app and go back to the dash.
241+ - apps lens shown and Running Apps visible on screen
243+ function test_minimizingAppTakesToRunningApps() {
244+ var dashApps = findChild(shell, "DashApps");
246+ swipeUntilScopeViewIsReached(dashApps);
248+ // swipe finger up until the running/recent apps section (which we assume
249+ // it's the first one) is as far from view as possible.
250+ // We also assume that DashApps is tall enough that it's scrollable
251+ var appsCategoryListView = findChild(dashApps, "categoryListView");
252+ while (!appsCategoryListView.atYEnd) {
253+ swipeUpFromCenter();
254+ tryCompare(appsCategoryListView, "moving", false);
257+ // Switch away from the Applications scope.
258+ swipeRightFromCenter();
259+ waitUntilItemStopsMoving(dashApps);
260+ verify(!itemIsOnScreen(dashApps));
262+ dragLauncherIntoView();
264+ // Launch an app from the launcher
265+ tapOnAppIconInLauncher();
267+ waitUntilApplicationWindowIsFullyVisible();
269+ // Minimize the application we just launched
270+ swipeFromLeftEdge();
272+ // Wait for the whole UI to settle down
273+ waitUntilApplicationWindowIsFullyHidden();
274+ waitUntilItemStopsMoving(dashApps);
275+ tryCompare(appsCategoryListView, "moving", false);
277+ verify(itemIsOnScreen(dashApps));
279+ var runningApplicationsGrid = findChild(appsCategoryListView, "recent");
280+ verify(runningApplicationsGrid);
281+ verify(itemIsOnScreen(runningApplicationsGrid));
216 // Wait for the whole UI to settle down
284 // Wait for the whole UI to settle down
217 function waitForUIToSettle() {
285 function waitForUIToSettle() {
218 waitUntilApplicationWindowIsFullyHidden();
286 waitUntilApplicationWindowIsFullyHidden();