on xenial help sign in
Revert the reversion of r304 since it doesn't seem to crash anymore
b2a4984Daniel d'Andrada
Dash/DashApps.qml+1
@@ -24,6 +24,7 @@ import "Apps"
24
24
25GenericScopeView {
25GenericScopeView {
26 id: scopeView
26 id: scopeView
27+ objectName: "DashApps"
27
28
28 // FIXME: a way to aggregate these models would be ideal
29 // FIXME: a way to aggregate these models would be ideal
29 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications
30 property var mainStageApplicationsModel: shell.applicationManager.mainStageApplications
Dash/DashContent.qml+1
@@ -114,6 +114,7 @@ Item {
114 height: ListView.view.height
114 height: ListView.view.height
115 asynchronous: true
115 asynchronous: true
116 source: scopeMapper.map(scope.id)
116 source: scopeMapper.map(scope.id)
117+ objectName: scope.id + " loader"
117
118
118 // these are needed for autopilot tests
119 // these are needed for autopilot tests
119 readonly property string scopeId: scope.id
120 readonly property string scopeId: scope.id
Dash/GenericScopeView.qml+3
@@ -30,6 +30,8 @@ ScopeView {
30
30
31 onMovementStarted: categoryView.showHeader()
31 onMovementStarted: categoryView.showHeader()
32
32
33+ onPositionedAtBeginning: categoryView.positionAtBeginning()
34+
33 Binding {
35 Binding {
34 target: scopeView.scope
36 target: scopeView.scope
35 property: "searchQuery"
37 property: "searchQuery"
@@ -58,6 +60,7 @@ ScopeView {
58
60
59 ScopeListView {
61 ScopeListView {
60 id: categoryView
62 id: categoryView
63+ objectName: "categoryListView"
61 anchors.fill: parent
64 anchors.fill: parent
62 model: scopeView.categories
65 model: scopeView.categories
63 forceNoClip: previewLoader.onScreen
66 forceNoClip: previewLoader.onScreen
Shell.qml+1−1
@@ -650,7 +650,7 @@ FocusScope {
650 onDashItemSelected: showHome()
650 onDashItemSelected: showHome()
651 onDash: {
651 onDash: {
652 if (stages.shown) {
652 if (stages.shown) {
653− dash.setCurrentScope("applications.scope", true, false)
653+ dash.setCurrentScope("applications.scope", true /* animate */, true /* reset */)
654 stages.hide();
654 stages.hide();
655 launcher.hide();
655 launcher.hide();
656 }
656 }
tests/mocks/Unity/fake_applications_scope.cpp+7
@@ -64,5 +64,12 @@ DeeModel* ApplicationsScope::createCategoriesModel()
64 "grid",
64 "grid",
65 hints);
65 hints);
66
66
67+ dee_model_append(category_model,
68+ "outdated",
69+ "Outdaded",
70+ "gtk-apply",
71+ "grid",
72+ hints);
73+
67 return category_model;
74 return category_model;
68}
75}
tests/qmltests/tst_Shell.qml+68
@@ -56,6 +56,18 @@ Item {
56
56
57 function initTestCase() {
57 function initTestCase() {
58 swipeAwayGreeter();
58 swipeAwayGreeter();
59+
60+ // Ensure DashHome is loaded before continuing
61+ var dashContentList = findChild(shell, "dashContentList");
62+ waitForRendering(dashContentList);
63+ var homeLoader = findChild(dashContentList, "home.scope loader");
64+ verify(homeLoader);
65+ tryCompareFunction(function() {return homeLoader.item !== undefined;}, true);
66+
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.
70+ wait(2000);
59 }
71 }
60
72
61 function cleanup() {
73 function cleanup() {
@@ -233,6 +245,62 @@ Item {
233 tryCompare(dash, "visible", false);
245 tryCompare(dash, "visible", false);
234 }
246 }
235
247
248+ /*
249+ Regression test for bug https://bugs.launchpad.net/touch-preview-images/+bug/1193419
250+
251+ When the user minimizes an application (left-edge swipe) he should always end up in the "Running Apps"
252+ category of the "Applications" scope view.
253+
254+ Steps:
255+ - go to apps lens
256+ - scroll to the bottom
257+ - reveal launcher and launch an app
258+ - perform long left edge swipe to go minimize the app and go back to the dash.
259+
260+ Expected Results
261+ - apps lens shown and Running Apps visible on screen
262+ */
263+ function test_minimizingAppTakesToRunningApps() {
264+ var dashApps = findChild(shell, "DashApps");
265+
266+ swipeUntilScopeViewIsReached(dashApps);
267+
268+ // swipe finger up until the running/recent apps section (which we assume
269+ // it's the first one) is as far from view as possible.
270+ // We also assume that DashApps is tall enough that it's scrollable
271+ var appsCategoryListView = findChild(dashApps, "categoryListView");
272+ while (!appsCategoryListView.atYEnd) {
273+ swipeUpFromCenter();
274+ tryCompare(appsCategoryListView, "moving", false);
275+ }
276+
277+ // Switch away from the Applications scope.
278+ swipeRightFromCenter();
279+ waitUntilItemStopsMoving(dashApps);
280+ verify(!itemIsOnScreen(dashApps));
281+
282+ dragLauncherIntoView();
283+
284+ // Launch an app from the launcher
285+ tapOnAppIconInLauncher();
286+
287+ waitUntilApplicationWindowIsFullyVisible();
288+
289+ // Minimize the application we just launched
290+ swipeFromLeftEdge();
291+
292+ // Wait for the whole UI to settle down
293+ waitUntilApplicationWindowIsFullyHidden();
294+ waitUntilItemStopsMoving(dashApps);
295+ tryCompare(appsCategoryListView, "moving", false);
296+
297+ verify(itemIsOnScreen(dashApps));
298+
299+ var runningApplicationsGrid = findChild(appsCategoryListView, "recent");
300+ verify(runningApplicationsGrid);
301+ verify(itemIsOnScreen(runningApplicationsGrid));
302+ }
303+
236 // Wait for the whole UI to settle down
304 // Wait for the whole UI to settle down
237 function waitForUIToSettle() {
305 function waitForUIToSettle() {
238 waitUntilApplicationWindowIsFullyHidden();
306 waitUntilApplicationWindowIsFullyHidden();