Merge lp:~mzanetti/unity8/drop-running-apps-from-dash into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1081
Merged at revision: 1097
Proposed branch: lp:~mzanetti/unity8/drop-running-apps-from-dash
Merge into: lp:unity8
Prerequisite: lp:~unity-team/unity8/mirCompositor
Diff against target: 705 lines (+5/-585)
11 files modified
qml/Dash/Apps/CloseIcon.qml (+0/-62)
qml/Dash/Apps/RunningApplicationTile.qml (+0/-136)
qml/Dash/Apps/RunningApplicationsGrid.qml (+0/-105)
qml/Dash/DashApps.qml (+0/-40)
qml/Dash/DashContent.qml (+1/-3)
qml/Dash/GenericScopeView.qml (+1/-10)
tests/autopilot/unity8/shell/emulators/dash.py (+0/-4)
tests/autopilot/unity8/shell/tests/test_emulators.py (+1/-1)
tests/qmltests/CMakeLists.txt (+0/-1)
tests/qmltests/Dash/Apps/tst_RunningApplicationsGrid.qml (+0/-217)
tests/qmltests/tst_Shell.qml (+2/-6)
To merge this branch: bzr merge lp:~mzanetti/unity8/drop-running-apps-from-dash
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Albert Astals Cid (community) Approve
Review via email: mp+227707@code.launchpad.net

Commit message

Drop Recent apps category from Dash

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.

see prereq

 * Did you perform an exploratory manual test run of your code change and any related functionality?

sure

 * Did you make sure that your branch does not contain spurious tags?

yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

nope

 * If you changed the UI, has there been a design review?

no real review... but this is wanted by design according to various bug reports and specs.

To post a comment you must log in.
1079. By Michael Zanetti

merge prereq

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1080. By Michael Zanetti

merge prereq

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1081. By Michael Zanetti

merge prereq

Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good to me

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
No, but it is exactly the changes i did when removing this on the non QtComp branch so it looks good

 * Did CI run pass? If not, please explain why.
No, unity8 : Depends: qtdeclarative5-qtmir-plugin (>= 0.4) but it is not installable

1082. By Michael Zanetti

merge prereq

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1083. By Michael Zanetti

merge prereq

1084. By Michael Zanetti

merge prereq

1085. By Michael Zanetti

merge prereq

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1086. By Michael Zanetti

merge prereq

1087. By Michael Zanetti

merge prereq

1088. By Michael Zanetti

merge prereq

1089. By Michael Zanetti

merge prereq

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'qml/Dash/Apps/CloseIcon.qml'
--- qml/Dash/Apps/CloseIcon.qml 2013-06-05 22:03:08 +0000
+++ qml/Dash/Apps/CloseIcon.qml 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18
19Item {
20 id: root
21
22 Image {
23 id: closeIcon
24 anchors.centerIn: parent
25 source: "graphics/close_btn.png"
26
27 state: (root.enabled) ? "shown" : "hidden"
28
29 states: [
30 State {
31 name: "shown"
32 PropertyChanges {
33 target: closeIcon
34 height: root.height
35 width: root.width
36 }
37 },
38 State {
39 name: "hidden"
40 PropertyChanges {
41 target: closeIcon
42 height: 0
43 width: 0
44 }
45 }
46
47 ]
48 transitions: [
49 Transition {
50 to: "shown"
51 NumberAnimation {
52 properties: "width, height"; duration: 300
53 easing { type: Easing.OutBack; overshoot: 5 }
54 }
55 },
56 Transition {
57 to: "hidden"
58 NumberAnimation { properties: "width, height"; duration: 250; }
59 }
60 ]
61 }
62}
630
=== removed file 'qml/Dash/Apps/RunningApplicationTile.qml'
--- qml/Dash/Apps/RunningApplicationTile.qml 2014-07-28 17:07:14 +0000
+++ qml/Dash/Apps/RunningApplicationTile.qml 1970-01-01 00:00:00 +0000
@@ -1,136 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import Unity.Application 0.1
20import "../../Components/"
21import "../../Components/ListItems"
22
23AbstractButton {
24 id: root
25 property var application
26
27 signal requestedApplicationActivation(var application)
28 signal requestedApplicationTermination(var application)
29 signal requestedActivationMode()
30 signal requestedTerminationMode()
31
32 width: thumbnail.width
33 height: thumbnail.height + labelContainer.height
34
35 property bool terminationModeEnabled: false
36
37 onClicked: {
38 if (!terminationModeEnabled)
39 requestedApplicationActivation(application)
40 }
41
42 onPressAndHold: {
43 if (terminationModeEnabled) {
44 requestedActivationMode()
45 } else {
46 requestedTerminationMode()
47 }
48 }
49
50 Item {
51 id: thumbnail
52
53 width: shapedApplicationImage.width
54 height: shapedApplicationImage.height
55
56 UbuntuShape {
57 id: shapedApplicationImage
58 x: 0
59 y: 0
60 height: applicationImage.height
61 width: applicationImage.width
62 radius: "medium"
63
64 image: Image {
65 id: applicationImage
66 source: application.screenshot
67 // height : width = ss.height : ss.width
68
69 property bool isLandscape: sourceSize.width > sourceSize.height
70 property real maxDimension: units.gu(17)
71
72 width: isLandscape ? Math.min(sourceSize.width, maxDimension) : height * (sourceSize.width / sourceSize.height)
73 height: isLandscape ? width * (sourceSize.height / sourceSize.width) : Math.min(sourceSize.height, maxDimension)
74 fillMode: Image.Stretch
75 }
76
77 }
78
79 UbuntuShape {
80 id: borderPressed
81
82 anchors.fill: shapedApplicationImage
83 radius: "medium"
84 borderSource: "radius_pressed.sci"
85 opacity: root.pressed ? 1.0 : 0.0
86 Behavior on opacity { NumberAnimation { duration: 200; easing.type: Easing.OutQuint } }
87 }
88 }
89
90 // FIXME: label code duplicated with Tile
91 Item {
92 id: labelContainer
93 anchors {
94 left: thumbnail.left
95 right: thumbnail.right
96 top: thumbnail.bottom
97 }
98 height: units.gu(2)
99
100 Label {
101 id: label
102 anchors {
103 baseline: parent.bottom
104 left: parent.left
105 right: parent.right
106 }
107 text: (application) ? application.name : ""
108
109 // TODO karni: Update Ubuntu.Components.Themes.Palette and use theme color instead
110 color: "grey"
111 opacity: 0.9
112 fontSize: "small"
113 elide: Text.ElideMiddle
114 horizontalAlignment: Text.AlignHCenter
115 }
116 }
117
118 CloseIcon {
119 objectName: "closeIcon " + model.name
120 anchors {
121 left: thumbnail.left
122 leftMargin: -units.gu(1)
123 top: thumbnail.top
124 topMargin: -units.gu(1)
125 }
126 height: units.gu(6)
127 width: units.gu(6)
128 id: closeIcon
129 enabled: root.terminationModeEnabled
130
131 MouseArea {
132 anchors { fill: parent; margins: -units.gu(1) }
133 onClicked: requestedApplicationTermination(application)
134 }
135 }
136}
1370
=== removed file 'qml/Dash/Apps/RunningApplicationsGrid.qml'
--- qml/Dash/Apps/RunningApplicationsGrid.qml 2014-03-25 11:34:34 +0000
+++ qml/Dash/Apps/RunningApplicationsGrid.qml 1970-01-01 00:00:00 +0000
@@ -1,105 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import "../../Components"
19
20import Ubuntu.Gestures 0.1
21import Unity.Application 0.1
22
23ResponsiveFlowView {
24 id: root
25 clip: true
26
27 signal updateScreenshots
28 property alias enableHeightBehavior: heightBehaviour.enabled
29 property bool enableHeightBehaviorOnNextCreation: model.count === 0
30
31 Behavior on height {
32 id: heightBehaviour
33 enabled: false
34 NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
35 }
36
37 Connections {
38 target: root.model
39 onCountChanged: {
40 heightBehaviour.enabled = true;
41 }
42 }
43
44 property bool canEnableTerminationMode: true
45
46 onCanEnableTerminationModeChanged: {
47 if (!canEnableTerminationMode)
48 terminationModeEnabled = false
49 }
50
51 // when false, it means it's on activation mode
52 property bool terminationModeEnabled: false
53
54 maximumNumberOfColumns: 10
55 minimumHorizontalSpacing: units.gu(2)
56 referenceDelegateWidth: units.gu(11)
57 verticalSpacing: units.gu(2)
58
59 delegate: Item {
60 width: runningAppTile.width + root.horizontalSpacing
61 height: runningAppTile.height + root.verticalSpacing
62
63 RunningApplicationTile {
64 id: runningAppTile
65 objectName: "runningAppTile " + model.name
66 anchors {
67 top: parent.top
68 horizontalCenter: parent.horizontalCenter
69 }
70 application: model
71 onRequestedActivationMode: { root.terminationModeEnabled = false }
72 onRequestedTerminationMode: {
73 if (canEnableTerminationMode)
74 root.terminationModeEnabled = true
75 }
76 onRequestedApplicationTermination: {
77 ApplicationManager.stopApplication(model.appId)
78 }
79 onRequestedApplicationActivation: {
80 ApplicationManager.requestFocusApplication(model.appId)
81 }
82
83 terminationModeEnabled: root.terminationModeEnabled
84 }
85 }
86
87 move: Transition {
88 NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutCubic }
89 }
90
91 MouseArea {
92 anchors.fill: parent
93 z: -1 // behind all RunningApplicationTiles
94 enabled: root.terminationModeEnabled
95 onPressed: { root.terminationModeEnabled = false; }
96 }
97
98 PressedOutsideNotifier {
99 anchors.fill: parent
100 enabled: root.terminationModeEnabled
101 onPressedOutside: {
102 root.terminationModeEnabled = false;
103 }
104 }
105}
1060
=== removed directory 'qml/Dash/Apps/graphics'
=== removed file 'qml/Dash/Apps/graphics/close_btn@9.png'
107Binary files qml/Dash/Apps/graphics/close_btn@9.png 2013-06-20 13:42:39 +0000 and qml/Dash/Apps/graphics/close_btn@9.png 1970-01-01 00:00:00 +0000 differ1Binary files qml/Dash/Apps/graphics/close_btn@9.png 2013-06-20 13:42:39 +0000 and qml/Dash/Apps/graphics/close_btn@9.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'qml/Dash/DashApps.qml'
--- qml/Dash/DashApps.qml 2014-03-28 00:32:46 +0000
+++ qml/Dash/DashApps.qml 1970-01-01 00:00:00 +0000
@@ -1,40 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import Utils 0.1
20import Unity.Application 0.1
21import "../Components"
22import "../Components/ListItems"
23import "Apps"
24
25GenericScopeView {
26 id: scopeView
27 objectName: "DashApps"
28
29 property var runningApps: ApplicationManager
30
31 QtObject {
32 id: countObject
33 property int count: scopeView.scope.searchQuery.length == 0 ? scopeView.runningApps.count : 0
34 }
35
36 onScopeChanged: {
37 scopeView.scope.categories.addSpecialCategory("running.apps.category", i18n.tr("Recent"), "", "{ \"template\": { \"category-layout\": \"running-apps\" } }", countObject);
38 enableHeightBehaviorOnNextCreation = scopeView.runningApps.count === 0
39 }
40}
410
=== modified file 'qml/Dash/DashContent.qml'
--- qml/Dash/DashContent.qml 2014-07-28 17:07:14 +0000
+++ qml/Dash/DashContent.qml 2014-07-28 17:07:15 +0000
@@ -126,9 +126,7 @@
126 return (xPositionRelativetoView > -width && xPositionRelativetoView < width) ? 1 : 0126 return (xPositionRelativetoView > -width && xPositionRelativetoView < width) ? 1 : 0
127 }127 }
128 asynchronous: true128 asynchronous: true
129 // TODO This if will eventually go away since we're killing DashApps.qml129 source: "GenericScopeView.qml"
130 // once we move app closing to the spread
131 source: (scope.id == "clickscope") ? "DashApps.qml" : "GenericScopeView.qml"
132 objectName: scope.id + " loader"130 objectName: scope.id + " loader"
133131
134 readonly property bool moving: item ? item.moving : false132 readonly property bool moving: item ? item.moving : false
135133
=== modified file 'qml/Dash/GenericScopeView.qml'
--- qml/Dash/GenericScopeView.qml 2014-07-24 20:40:44 +0000
+++ qml/Dash/GenericScopeView.qml 2014-07-28 17:07:15 +0000
@@ -18,7 +18,6 @@
18import Ubuntu.Components 0.118import Ubuntu.Components 0.1
19import Utils 0.119import Utils 0.1
20import Unity 0.220import Unity 0.2
21import Unity.Application 0.1
22import Dash 0.121import Dash 0.1
23import "../Components"22import "../Components"
24import "../Components/ListItems" as ListItems23import "../Components/ListItems" as ListItems
@@ -194,7 +193,6 @@
194 switch (cardTool.categoryLayout) {193 switch (cardTool.categoryLayout) {
195 case "carousel": return "CardCarousel.qml";194 case "carousel": return "CardCarousel.qml";
196 case "vertical-journal": return "CardVerticalJournal.qml";195 case "vertical-journal": return "CardVerticalJournal.qml";
197 case "running-apps": return "Apps/RunningApplicationsGrid.qml";
198 case "grid":196 case "grid":
199 default: return "CardGrid.qml";197 default: return "CardGrid.qml";
200 }198 }
@@ -205,14 +203,7 @@
205 item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;203 item.enableHeightBehavior = scopeView.enableHeightBehaviorOnNextCreation;
206 scopeView.enableHeightBehaviorOnNextCreation = false;204 scopeView.enableHeightBehaviorOnNextCreation = false;
207 }205 }
208 if (source.toString().indexOf("Apps/RunningApplicationsGrid.qml") != -1) {206 item.model = Qt.binding(function() { return results })
209 // TODO: this is still a kludge :D Ideally add some kind of hook so that we
210 // can do this from DashApps.qml or think a better way that needs no special casing
211 item.model = Qt.binding(function() { return runningApps; })
212 item.canEnableTerminationMode = Qt.binding(function() { return scopeView.isCurrent })
213 } else {
214 item.model = Qt.binding(function() { return results })
215 }
216 item.objectName = Qt.binding(function() { return categoryId })207 item.objectName = Qt.binding(function() { return categoryId })
217 item.scopeStyle = scopeView.scopeStyle;208 item.scopeStyle = scopeView.scopeStyle;
218 if (baseItem.expandable) {209 if (baseItem.expandable) {
219210
=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
--- tests/autopilot/unity8/shell/emulators/dash.py 2014-07-25 10:47:19 +0000
+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-07-28 17:07:15 +0000
@@ -188,10 +188,6 @@
188 raise emulators.UnityEmulatorException(188 raise emulators.UnityEmulatorException(
189 'No category found with name {}'.format(category))189 'No category found with name {}'.format(category))
190190
191
192class DashApps(GenericScopeView):
193 """Autopilot emulator for the applications scope."""
194
195 def get_applications(self, category):191 def get_applications(self, category):
196 """Return the list of applications on a category.192 """Return the list of applications on a category.
197193
198194
=== modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
--- tests/autopilot/unity8/shell/tests/test_emulators.py 2014-07-24 14:45:36 +0000
+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-07-28 17:07:15 +0000
@@ -142,7 +142,7 @@
142 scope_id = 'clickscope'142 scope_id = 'clickscope'
143 scope = self.dash.open_scope(scope_id)143 scope = self.dash.open_scope(scope_id)
144 self._assert_scope_is_opened(scope, scope_id)144 self._assert_scope_is_opened(scope, scope_id)
145 self.assertIsInstance(scope, dash_emulators.DashApps)145 self.assertIsInstance(scope, dash_emulators.GenericScopeView)
146146
147147
148class GenericScopeViewEmulatorTestCase(DashBaseTestCase):148class GenericScopeViewEmulatorTestCase(DashBaseTestCase):
149149
=== modified file 'tests/qmltests/CMakeLists.txt'
--- tests/qmltests/CMakeLists.txt 2014-07-21 23:38:11 +0000
+++ tests/qmltests/CMakeLists.txt 2014-07-28 17:07:15 +0000
@@ -40,7 +40,6 @@
40add_qml_benchmark(Dash CardBenchmark 1000)40add_qml_benchmark(Dash CardBenchmark 1000)
41add_qml_test(Dash CardTool)41add_qml_test(Dash CardTool)
42add_qml_test(Dash GenericScopeView)42add_qml_test(Dash GenericScopeView)
43add_qml_test(Dash/Apps RunningApplicationsGrid)
44add_qml_test(Dash/Previews Preview)43add_qml_test(Dash/Previews Preview)
45add_qml_test(Dash/Previews PreviewActions)44add_qml_test(Dash/Previews PreviewActions)
46add_qml_test(Dash/Previews PreviewAudioPlayback)45add_qml_test(Dash/Previews PreviewAudioPlayback)
4746
=== removed file 'tests/qmltests/Dash/Apps/tst_RunningApplicationsGrid.qml'
--- tests/qmltests/Dash/Apps/tst_RunningApplicationsGrid.qml 2014-07-28 17:07:14 +0000
+++ tests/qmltests/Dash/Apps/tst_RunningApplicationsGrid.qml 1970-01-01 00:00:00 +0000
@@ -1,217 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtTest 1.0
19import "../../../../qml/Dash/Apps"
20import Unity.Test 0.1 as UT
21import Unity.Application 0.1
22import Ubuntu.Components 1.1
23
24// Using Rectangle to have an opaque surface because AppManager paints app surfaces behind it.
25Rectangle {
26 width: units.gu(70)
27 height: units.gu(40)
28
29 function resetRunningApplications() {
30 while (ApplicationManager.count > 0) {
31 ApplicationManager.stopApplication(ApplicationManager.get(0).appId)
32 }
33
34 ApplicationManager.startApplication("dialer-app");
35 ApplicationManager.startApplication("webbrowser-app");
36 }
37
38 Component.onCompleted: {
39 resetRunningApplications()
40 }
41
42 // The component under test
43 RunningApplicationsGrid {
44 id: runningApplicationsGrid
45 orientationAngle: orientationAngleSelector.selectedIndex * 90
46 anchors.left: parent.left
47 anchors.right: controlPanel.left
48 anchors.top: parent.top
49 anchors.bottom: parent.bottom
50 model: ApplicationManager
51 }
52
53 Rectangle {
54 id: controlPanel
55 anchors.right: parent.right
56 anchors.top: parent.top
57 anchors.bottom: parent.bottom
58 width: units.gu(20)
59 color: "black"
60
61 OptionSelector {
62 id: orientationAngleSelector
63 model: ["0","90","180","270"]
64 text: "Orientation Angle"
65 width: parent.width
66 }
67 }
68
69 UT.UnityTestCase {
70 name: "RunningApplicationsGrid"
71 when: windowShown
72
73 function init() {
74 runningApplicationsGrid.terminationModeEnabled = false
75 resetRunningApplications()
76 }
77
78 property var browserTile
79 property var phoneTile
80
81 property var isBrowserLongPressed: false
82 function onBrowserLongPressed() {isBrowserLongPressed = true}
83
84 property var isPhoneLongPressed: false
85 function onPhoneLongPressed() {isPhoneLongPressed = true}
86
87 // Tiles should go to termination mode when any one of them is long-pressed.
88 // Long-pressing when they're in termination mode brings them back to activation mode
89 function test_enterTerminationMode() {
90 browserTile = findChild(runningApplicationsGrid, "runningAppTile Browser")
91 verify(browserTile != undefined)
92 browserTile.onPressAndHold.connect(onBrowserLongPressed)
93
94 phoneTile = findChild(runningApplicationsGrid, "runningAppTile Dialer")
95 verify(phoneTile != undefined)
96 phoneTile.onPressAndHold.connect(onPhoneLongPressed)
97
98 compare(browserTile.terminationModeEnabled, false)
99 compare(phoneTile.terminationModeEnabled, false)
100 compare(runningApplicationsGrid.terminationModeEnabled, false)
101
102 isBrowserLongPressed = false
103 mousePress(browserTile, browserTile.width/2, browserTile.height/2)
104 tryCompareFunction(checkSwitchToTerminationModeAfterLongPress, true)
105
106 mouseRelease(browserTile, browserTile.width/2, browserTile.height/2)
107
108 compare(browserTile.terminationModeEnabled, true)
109 compare(phoneTile.terminationModeEnabled, true)
110 compare(runningApplicationsGrid.terminationModeEnabled, true)
111
112 isPhoneLongPressed = false
113 mousePress(phoneTile, phoneTile.width/2, phoneTile.height/2)
114 tryCompareFunction(checkSwitchToActivationModeAfterLongPress, true)
115
116 mouseRelease(phoneTile, phoneTile.width/2, phoneTile.height/2)
117
118 compare(browserTile.terminationModeEnabled, false)
119 compare(phoneTile.terminationModeEnabled, false)
120 compare(runningApplicationsGrid.terminationModeEnabled, false)
121
122 browserTile.onPressAndHold.disconnect(onBrowserLongPressed)
123 phoneTile.onPressAndHold.disconnect(onPhoneLongPressed)
124 }
125
126 // Checks that components swicth to termination mode after (and only after) a long
127 // press happens on Browser tile.
128 function checkSwitchToTerminationModeAfterLongPress() {
129 compare(browserTile.terminationModeEnabled, isBrowserLongPressed)
130 compare(phoneTile.terminationModeEnabled, isBrowserLongPressed)
131 compare(runningApplicationsGrid.terminationModeEnabled, isBrowserLongPressed)
132
133 return isBrowserLongPressed &&
134 browserTile.terminationModeEnabled &&
135 phoneTile.terminationModeEnabled &&
136 runningApplicationsGrid.terminationModeEnabled
137 }
138
139 // Checks that components swicth to activation mode after (and only after) a long
140 // press happens on Phone tile.
141 function checkSwitchToActivationModeAfterLongPress() {
142 compare(browserTile.terminationModeEnabled, !isPhoneLongPressed)
143 compare(phoneTile.terminationModeEnabled, !isPhoneLongPressed)
144 compare(runningApplicationsGrid.terminationModeEnabled, !isPhoneLongPressed)
145
146 return isPhoneLongPressed &&
147 !browserTile.terminationModeEnabled &&
148 !phoneTile.terminationModeEnabled &&
149 !runningApplicationsGrid.terminationModeEnabled
150 }
151
152 // While on termination mode, clicking a running application tile, outside of
153 // the close icon should do nothing
154 function test_clickTileNotClose() {
155 runningApplicationsGrid.terminationModeEnabled = true
156
157 var browserTile = findChild(runningApplicationsGrid, "runningAppTile Browser")
158 verify(browserTile != undefined)
159
160 verify(ApplicationManager.findApplication("webbrowser-app") !== null)
161
162 mouseClick(browserTile, browserTile.width/2, browserTile.height/2)
163
164 verify(ApplicationManager.findApplication("webbrowser-app") !== null)
165
166 // The tile for the Browser app should stay there
167 tryCompareFunction(checkBrowserTileExists, true)
168 }
169
170 // While in termination mode, clicking on a running application tile's close icon
171 // causes the corresponding application to be terminated
172 function test_clickCloseIconToTerminateApp() {
173 runningApplicationsGrid.terminationModeEnabled = true
174
175 var browserTile = findChild(runningApplicationsGrid, "runningAppTile Browser")
176 var browserTileCloseButton = findChild(runningApplicationsGrid, "closeIcon Browser")
177
178 verify(browserTile != undefined)
179 verify(browserTileCloseButton != undefined)
180 verify(ApplicationManager.findApplication("webbrowser-app") !== 0)
181
182 mouseClick(browserTileCloseButton, browserTileCloseButton.width/2, browserTileCloseButton.height/2)
183 wait(0) // spin event loop to start any pending animation
184
185 verify(ApplicationManager.findApplication("webbrowser-app") === null)
186
187 // The tile for the Browser app should eventually vanish since the
188 // application has been terminated.
189 tryCompareFunction(checkBrowserTileExists, false)
190 }
191
192 function checkBrowserTileExists() {
193 return findChild(runningApplicationsGrid, "runningAppTile Browser")
194 != undefined
195 }
196
197 // While in termination mode, if you click outside any of the tiles, the
198 // termination mode is disabled (i.e. we switch back to activation mode).
199 function test_clickOutsideTilesDisablesTerminationMode() {
200 runningApplicationsGrid.terminationModeEnabled = true
201
202 var browserTile = findChild(runningApplicationsGrid, "runningAppTile Browser")
203 verify(browserTile != undefined)
204
205 verify(runningApplicationsGrid.terminationModeEnabled);
206
207 // Click on the bottom right corner of the grid, where there's no
208 // RunningApplicationTile lying around
209 mouseClick(runningApplicationsGrid,
210 runningApplicationsGrid.width - 1, runningApplicationsGrid.height - 1);
211
212 wait(0) // spin event loop to ensure that any pending signal emission went through
213
214 verify(!runningApplicationsGrid.terminationModeEnabled);
215 }
216 }
217}
2180
=== modified file 'tests/qmltests/tst_Shell.qml'
--- tests/qmltests/tst_Shell.qml 2014-07-28 17:07:14 +0000
+++ tests/qmltests/tst_Shell.qml 2014-07-28 17:07:15 +0000
@@ -313,9 +313,9 @@
313 - perform long left edge swipe to go minimize the app and go back to the dash.313 - perform long left edge swipe to go minimize the app and go back to the dash.
314314
315 Expected Results315 Expected Results
316 - apps lens shown and Running Apps visible on screen316 - apps lens shown
317 */317 */
318 function test_minimizingAppTakesToRunningApps() {318 function test_minimizingAppTakesToDashApps() {
319 var dashApps = findChild(shell, "clickscope");319 var dashApps = findChild(shell, "clickscope");
320 swipeUntilScopeViewIsReached(dashApps);320 swipeUntilScopeViewIsReached(dashApps);
321321
@@ -353,10 +353,6 @@
353 tryCompare(appsCategoryListView, "moving", false);353 tryCompare(appsCategoryListView, "moving", false);
354354
355 verify(itemIsOnScreen(dashApps));355 verify(itemIsOnScreen(dashApps));
356
357 var runningApplicationsGrid = findChild(appsCategoryListView, "running.apps.category");
358 verify(runningApplicationsGrid);
359 verify(itemIsOnScreen(runningApplicationsGrid));
360 }356 }
361357
362 function test_showInputMethod() {358 function test_showInputMethod() {

Subscribers

People subscribed via source and target branches