Merge lp:~dandrader/unity8/app-state-handling into lp:unity8
- app-state-handling
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Albert Astals Cid |
Approved revision: | 1829 |
Merged at revision: | 1901 |
Proposed branch: | lp:~dandrader/unity8/app-state-handling |
Merge into: | lp:unity8 |
Prerequisite: | lp:~dandrader/unity8/autoInstallTouchRegistry |
Diff against target: |
1115 lines (+468/-121) 22 files modified
CMakeLists.txt (+1/-1) debian/control (+1/-1) plugins/Greeter/Unity/Launcher/CMakeLists.txt (+0/-1) plugins/Unity/Launcher/CMakeLists.txt (+0/-1) qml/Components/Unity8Settings.qml (+50/-0) qml/OrientedShell.qml (+3/-3) qml/Shell.qml (+10/-12) qml/Stages/DesktopStage.qml (+13/-0) qml/Stages/PhoneStage.qml (+10/-0) qml/Stages/TabletStage.qml (+14/-0) tests/mocks/Unity/Application/ApplicationInfo.cpp (+40/-6) tests/mocks/Unity/Application/ApplicationInfo.h (+7/-0) tests/mocks/Unity/Application/ApplicationManager.cpp (+2/-49) tests/mocks/Unity/Application/ApplicationManager.h (+0/-7) tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt (+0/-1) tests/plugins/Unity/Launcher/launchermodeltest.cpp (+3/-4) tests/qmltests/Stages/ApplicationCheckBox.qml (+21/-0) tests/qmltests/Stages/tst_DesktopStage.qml (+2/-2) tests/qmltests/Stages/tst_PhoneStage.qml (+75/-3) tests/qmltests/Stages/tst_TabletStage.qml (+161/-1) tests/qmltests/tst_OrientedShell.qml (+3/-3) tests/qmltests/tst_Shell.qml (+52/-26) |
To merge this branch: | bzr merge lp:~dandrader/unity8/app-state-handling |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Albert Astals Cid (community) | Abstain | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Gerry Boland (community) | Approve | ||
Review via email: mp+258653@code.launchpad.net |
Commit message
Stages now control the "requestedState" property of applications
We now decide whether a application is suspended or not via the new Application.
Previously that was controlled by qtmir and tied to Application.focus. We don't want that anymore since it does not apply to a windowed usage mode scenario, for instance.
Description of the change
This branch contains lp:~dandrader/unity8/fixOrientedShellTests and lp:~dandrader/unity8/fixShellTests since I cannot set multiple prerequisites
* Are there any related MPs required for this MP to build/function as expected? Please list.
https:/
https:/
This also has https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* 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?
Not applicable
* If you changed the UI, has there been a design review?
Not applicable
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1772
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Text conflict in plugins/
Text conflict in plugins/
2 conflicts encountered.
Daniel d'Andrada (dandrader) wrote : | # |
> Text conflict in plugins/
> Text conflict in plugins/
> 2 conflicts encountered.
Fixed.
Gerry Boland (gerboland) wrote : | # |
Please update commit message to refer to "requestedState" instead of the old "active" application property.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1775
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
> Please update commit message to refer to "requestedState" instead of the old
> "active" application property.
Done.
Gerry Boland (gerboland) wrote : | # |
Bug:
via launcher, rapidly launch camera, webbrowser and contacts. When contacts finally appears, open spread: camera app is showing live preview, it should be suspended. Browser is also running. If you return to dash, the wakelock is not released (as other apps considered "running"
Gerry Boland (gerboland) wrote : | # |
Bug: open camera app. Then open gallery. Tap the camera icon in the Gallery header. It should cause focus to switch to the camera app, but actually nothing happens
Gerry Boland (gerboland) wrote : | # |
Bug (probably same as above, but reporting for completeness), if Settings app running, another app open and focused, open indicators and select "Battery Settings" menu option - nothing happens. Indicators should close and Settings app brought to front.
Gerry Boland (gerboland) wrote : | # |
Bug: open system settings. Switch to dash. Via ssh, kill the system-settings process. Then switch to the system settings app in unity8. It should cause the process to be respawned, but it appears to do nothing.
Gerry Boland (gerboland) wrote : | # |
Bug: launch camera, then immediately hit the power key to turn off the display. Camera app is not suspended. Wakelock is held.
Daniel d'Andrada (dandrader) wrote : | # |
On 13/05/15 12:45, Gerry Boland wrote:
> Review: Needs Fixing
>
> Bug:
> via launcher, rapidly launch camera, webbrowser and contacts. When contacts finally appears, open spread: camera app is showing live preview, it should be suspended. Browser is also running. If you return to dash, the wakelock is not released (as other apps considered "running"
unity8 logic is sound and working fine in that case. Problem lies in
qtmir. Just realized how messy the relationship between application
state, session state and surface creation is. Man, this is going to take
some refactoring...
Albert Astals Cid (aacid) wrote : | # |
Text conflict in tests/plugins/
Text conflict in tests/qmltests/
2 conflicts encountered.
Daniel d'Andrada (dandrader) wrote : | # |
On 21/05/2015 09:04, Albert Astals Cid wrote:
> Text conflict in tests/plugins/
> Text conflict in tests/qmltests/
> 2 conflicts encountered.
>
Fixed.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1776
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
On 13/05/15 12:45, Gerry Boland wrote:
> Review: Needs Fixing
>
> Bug:
> via launcher, rapidly launch camera, webbrowser and contacts. When contacts finally appears, open spread: camera app is showing live preview, it should be suspended. Browser is also running. If you return to dash, the wakelock is not released (as other apps considered "running"
Fixed.
Daniel d'Andrada (dandrader) wrote : | # |
On 13/05/15 12:49, Gerry Boland wrote:
> Bug: open camera app. Then open gallery. Tap the camera icon in the Gallery header. It should cause focus to switch to the camera app, but actually nothing happens
Fixed in qtmir.
Daniel d'Andrada (dandrader) wrote : | # |
On 13/05/15 13:11, Gerry Boland wrote:
> Bug (probably same as above, but reporting for completeness), if Settings app running, another app open and focused, open indicators and select "Battery Settings" menu option - nothing happens. Indicators should close and Settings app brought to front.
It is. Fixed in qtmir.
Daniel d'Andrada (dandrader) wrote : | # |
On 13/05/15 13:16, Gerry Boland wrote:
> Review: Needs Fixing
>
> Bug: open system settings. Switch to dash. Via ssh, kill the system-settings process. Then switch to the system settings app in unity8. It should cause the process to be respawned, but it appears to do nothing.
Fixed.
Daniel d'Andrada (dandrader) wrote : | # |
On 13/05/15 13:21, Gerry Boland wrote:
> Bug: launch camera, then immediately hit the power key to turn off the display. Camera app is not suspended. Wakelock is held.
Fixed.
Daniel d'Andrada (dandrader) wrote : | # |
On 27/05/15 18:15, Daniel d'Andrada wrote:
> On 13/05/15 12:45, Gerry Boland wrote:
>> Review: Needs Fixing
>>
>> Bug:
>> via launcher, rapidly launch camera, webbrowser and contacts. When contacts finally appears, open spread: camera app is showing live preview, it should be suspended. Browser is also running. If you return to dash, the wakelock is not released (as other apps considered "running"
> Fixed.
>
Fixed in qtmir, to be more clear.
Gerry Boland (gerboland) wrote : | # |
Pass 2 testing. Things much improved! Am still testing, but found this small issue:
Start dialer-app, let it load. Switch to Dash. Wait until dialer-app suspended. Kill it from command line. Then open spread and select Dialer app. There is a nasty flicker between the old snapshot disappearing & the resumed app's first frame.
Daniel d'Andrada (dandrader) wrote : | # |
On 29/05/15 19:29, Gerry Boland wrote:
> Review: Needs Fixing
>
> Pass 2 testing. Things much improved! Am still testing, but found this small issue:
>
> Start dialer-app, let it load. Switch to Dash. Wait until dialer-app suspended. Kill it from command line. Then open spread and select Dialer app. There is a nasty flicker between the old snapshot disappearing & the resumed app's first frame.
>
>
Fixed in qtmir.
The flicker is the whole SpreadDelegate disappearing for a split second.
After spending 1.5 workdays on it I still don't know exactly how or why
it was happening. But at least I found that a simple and harmless change
in qtmir makes it go away (deferring respawning of the app to the next
event loop by using a queued connection instead of a direct one).
It was also pretty curious that a short right-edge swipe didn't exhibit
this issue.
Lukáš Tinkl (lukas-kde) wrote : | # |
Added a clarification/
Daniel d'Andrada (dandrader) wrote : | # |
> Added a clarification/
Updated the FIXME comment. Thanks.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1777
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1822
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Text conflict in tests/qmltests/
1 conflicts encountered.
Daniel d'Andrada (dandrader) wrote : | # |
On 23/06/15 04:34, Albert Astals Cid wrote:
> Text conflict in tests/qmltests/
> 1 conflicts encountered.
Fixed.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1823
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Gerry Boland (gerboland) wrote : | # |
Looking good on desktop
Gerry Boland (gerboland) wrote : | # |
Ok, tested on phone, tablet & desktop. Unable to find any regression, nice one.
Gerry Boland (gerboland) wrote : | # |
I can't fault the code. Functional testing works well. AP tests pass here. Approve!
* Did you perform an exploratory manual test run of the code change and any related functionality?
Y
* Did CI run pass? If not, please explain why.
Depends on qtmir/unity-api change
* Did you make sure that the branch does not contain spurious tags?
Y
Albert Astals Cid (aacid) wrote : | # |
Setting as needs fixing because of
Text conflict in qml/OrientedShe
Text conflict in tests/qmltests/
2 conflicts encountered.
Should top-approve again once re-merged
Daniel d'Andrada (dandrader) wrote : | # |
On 06/07/15 04:20, Albert Astals Cid wrote:
> Review: Needs Fixing
>
> Setting as needs fixing because of
> Text conflict in qml/OrientedShe
> Text conflict in tests/qmltests/
> 2 conflicts encountered.
>
> Should top-approve again once re-merged
Fixed.
Gerry Boland (gerboland) wrote : | # |
Need to depend on unity-api 7.98
Daniel d'Andrada (dandrader) wrote : | # |
> Need to depend on unity-api 7.98
Done.
Gerry Boland (gerboland) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1826
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Gerry Boland (gerboland) wrote : | # |
Please merge trunk, some conflicts have appeared
Gerry Boland (gerboland) wrote : | # |
My fault, merges ok
Albert Astals Cid (aacid) wrote : | # |
Text conflict in plugins/
Text conflict in plugins/
Text conflict in qml/Shell.qml
Text conflict in qml/Stages/
Text conflict in tests/plugins/
Text conflict in tests/qmltests/
Was top approved before
- 1827. By Daniel d'Andrada
-
Merge trunk
[ CI Train Bot ]
* Resync trunk.
* allow opening the manage dash area by clicking with a mouse on the
arrow label (LP: #1431564)
* TouchRegistry: remove null candidates from list of candidates (LP:
#1473492)
[ Lukáš Tinkl ]
* Fix power dialogs on desktop
* Provide DBUS compatibility with various session services
(suspend/hibernate, lock/unlock, screensaver, etc)
* React on PrtScr keyboard shortcut for taking screenshots on desktop
(LP: #1474149)
* launcher parity: close apps from quicklist (LP: #1457201)
[ Michael Zanetti ]
* Implement first edition for a desktop Alt+Tab spread
* drop the gcc-4.9 dependency (LP: #1452348)
[ Mirco Müller ]
* Added corresponding tests and visual tweaks to a launcher-item's
progress-overlay.
* Added corresponding tests and visual tweaks to a launcher-item's
progress-overlay.
* Implemented alert/wiggle feature for launcher-icons.
* Implemented alert/wiggle feature for launcher-icons.
[ handsome_feng ]
* makes left swip reset the search string. (LP: #1413791)
[ handsome_feng<email address hidden> ]
* Don't expand indicators when tap to return to call. (LP: #1453217)
* makes left swip reset the search string. (LP: #1413791) - 1828. By Daniel d'Andrada
-
Remove stuff
- 1829. By Daniel d'Andrada
-
Update debian/control
Daniel d'Andrada (dandrader) wrote : | # |
On 03/08/15 10:20, Albert Astals Cid wrote:
> Review: Needs Fixing
>
> Text conflict in plugins/
> Text conflict in plugins/
> Text conflict in qml/Shell.qml
> Text conflict in qml/Stages/
> Text conflict in tests/plugins/
> Text conflict in tests/qmltests/
>
> Was top approved before
Fixed.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1829
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) : | # |
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2015-06-17 12:14:27 +0000 | |||
3 | +++ CMakeLists.txt 2015-08-03 14:21:12 +0000 | |||
4 | @@ -56,7 +56,7 @@ | |||
5 | 56 | find_package(Qt5Concurrent 5.2 REQUIRED) | 56 | find_package(Qt5Concurrent 5.2 REQUIRED) |
6 | 57 | find_package(Qt5Sql 5.2 REQUIRED) | 57 | find_package(Qt5Sql 5.2 REQUIRED) |
7 | 58 | 58 | ||
9 | 59 | pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6) | 59 | pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=7) |
10 | 60 | 60 | ||
11 | 61 | # Standard install paths | 61 | # Standard install paths |
12 | 62 | include(GNUInstallDirs) | 62 | include(GNUInstallDirs) |
13 | 63 | 63 | ||
14 | === modified file 'debian/control' | |||
15 | --- debian/control 2015-07-29 12:38:53 +0000 | |||
16 | +++ debian/control 2015-08-03 14:21:12 +0000 | |||
17 | @@ -28,7 +28,7 @@ | |||
18 | 28 | libqt5xmlpatterns5-dev, | 28 | libqt5xmlpatterns5-dev, |
19 | 29 | libsystemsettings-dev, | 29 | libsystemsettings-dev, |
20 | 30 | libudev-dev, | 30 | libudev-dev, |
22 | 31 | libunity-api-dev (>= 7.98), | 31 | libunity-api-dev (>= 7.99), |
23 | 32 | libusermetricsoutput1-dev, | 32 | libusermetricsoutput1-dev, |
24 | 33 | libxcb1-dev, | 33 | libxcb1-dev, |
25 | 34 | pkg-config, | 34 | pkg-config, |
26 | 35 | 35 | ||
27 | === modified file 'plugins/Greeter/Unity/Launcher/CMakeLists.txt' | |||
28 | --- plugins/Greeter/Unity/Launcher/CMakeLists.txt 2015-07-23 10:31:56 +0000 | |||
29 | +++ plugins/Greeter/Unity/Launcher/CMakeLists.txt 2015-08-03 14:21:12 +0000 | |||
30 | @@ -1,5 +1,4 @@ | |||
31 | 1 | pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7) | 1 | pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7) |
32 | 2 | pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6) | ||
33 | 3 | pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt) | 2 | pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt) |
34 | 4 | 3 | ||
35 | 5 | add_definitions(-DSM_BUSNAME=systemBus) | 4 | add_definitions(-DSM_BUSNAME=systemBus) |
36 | 6 | 5 | ||
37 | === modified file 'plugins/Unity/Launcher/CMakeLists.txt' | |||
38 | --- plugins/Unity/Launcher/CMakeLists.txt 2015-07-23 10:31:56 +0000 | |||
39 | +++ plugins/Unity/Launcher/CMakeLists.txt 2015-08-03 14:21:12 +0000 | |||
40 | @@ -1,5 +1,4 @@ | |||
41 | 1 | pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7) | 1 | pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7) |
42 | 2 | pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6) | ||
43 | 3 | pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt) | 2 | pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt) |
44 | 4 | 3 | ||
45 | 5 | add_definitions(-DSM_BUSNAME=systemBus) | 4 | add_definitions(-DSM_BUSNAME=systemBus) |
46 | 6 | 5 | ||
47 | === added file 'qml/Components/Unity8Settings.qml' | |||
48 | --- qml/Components/Unity8Settings.qml 1970-01-01 00:00:00 +0000 | |||
49 | +++ qml/Components/Unity8Settings.qml 2015-08-03 14:21:12 +0000 | |||
50 | @@ -0,0 +1,50 @@ | |||
51 | 1 | /* | ||
52 | 2 | * Copyright (C) 2015 Canonical, Ltd. | ||
53 | 3 | * | ||
54 | 4 | * This program is free software; you can redistribute it and/or modify | ||
55 | 5 | * it under the terms of the GNU General Public License as published by | ||
56 | 6 | * the Free Software Foundation; version 3. | ||
57 | 7 | * | ||
58 | 8 | * This program is distributed in the hope that it will be useful, | ||
59 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
60 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
61 | 11 | * GNU General Public License for more details. | ||
62 | 12 | * | ||
63 | 13 | * You should have received a copy of the GNU General Public License | ||
64 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
65 | 15 | */ | ||
66 | 16 | |||
67 | 17 | import QtQuick 2.0 | ||
68 | 18 | import GSettings 1.0 | ||
69 | 19 | |||
70 | 20 | QtObject { | ||
71 | 21 | id: root | ||
72 | 22 | |||
73 | 23 | property string usageMode: "Staged" | ||
74 | 24 | |||
75 | 25 | // FIXME: Works around a bug where if we change a Loader's source in response to a GSettings | ||
76 | 26 | // property change in the same event loop, the Loader's previously loaded component does not | ||
77 | 27 | // get destroyed and its bindings continue to operate! | ||
78 | 28 | // | ||
79 | 29 | // Shouldn't be needed after | ||
80 | 30 | // https://code.launchpad.net/~lukas-kde/gsettings-qt/queued-processing/+merge/259883 gets | ||
81 | 31 | // merged. | ||
82 | 32 | property var timer: Timer { | ||
83 | 33 | interval: 1 | ||
84 | 34 | onTriggered: { root.usageMode = root.wrapped.usageMode; } | ||
85 | 35 | } | ||
86 | 36 | property var wrappedConnections: Connections { | ||
87 | 37 | target: root.wrapped | ||
88 | 38 | ignoreUnknownSignals: true // don't spam us | ||
89 | 39 | onUsageModeChanged: { root.timer.start(); } | ||
90 | 40 | } | ||
91 | 41 | property var wrapped: GSettings { | ||
92 | 42 | schema.id: "com.canonical.Unity8" | ||
93 | 43 | Component.onCompleted: { | ||
94 | 44 | // init the value. it's a dynamic prop, so we have to check first | ||
95 | 45 | if (root.usageMode) { | ||
96 | 46 | root.usageMode = root.wrapped.usageMode; | ||
97 | 47 | } | ||
98 | 48 | } | ||
99 | 49 | } | ||
100 | 50 | } | ||
101 | 0 | 51 | ||
102 | === modified file 'qml/OrientedShell.qml' | |||
103 | --- qml/OrientedShell.qml 2015-07-01 17:52:34 +0000 | |||
104 | +++ qml/OrientedShell.qml 2015-08-03 14:21:12 +0000 | |||
105 | @@ -43,7 +43,7 @@ | |||
106 | 43 | 43 | ||
107 | 44 | 44 | ||
108 | 45 | // to be overwritten by tests | 45 | // to be overwritten by tests |
110 | 46 | property var usageModeSettings: GSettings { schema.id: "com.canonical.Unity8" } | 46 | property var unity8Settings: Unity8Settings {} |
111 | 47 | property var oskSettings: GSettings { schema.id: "com.canonical.keyboard.maliit" } | 47 | property var oskSettings: GSettings { schema.id: "com.canonical.keyboard.maliit" } |
112 | 48 | 48 | ||
113 | 49 | property int physicalOrientation: Screen.orientation | 49 | property int physicalOrientation: Screen.orientation |
114 | @@ -160,9 +160,9 @@ | |||
115 | 160 | // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen), | 160 | // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen), |
116 | 161 | // what's the output device (eg: big TV, desktop monitor, phone display), etc. | 161 | // what's the output device (eg: big TV, desktop monitor, phone display), etc. |
117 | 162 | usageScenario: { | 162 | usageScenario: { |
119 | 163 | if (root.usageModeSettings.usageMode === "Windowed") { | 163 | if (root.unity8Settings.usageMode === "Windowed") { |
120 | 164 | return "desktop"; | 164 | return "desktop"; |
122 | 165 | } else if (root.usageModeSettings.usageMode === "Staged") { | 165 | } else if (root.unity8Settings.usageMode === "Staged") { |
123 | 166 | if (deviceConfiguration.category === "phone") { | 166 | if (deviceConfiguration.category === "phone") { |
124 | 167 | return "phone"; | 167 | return "phone"; |
125 | 168 | } else { | 168 | } else { |
126 | 169 | 169 | ||
127 | === modified file 'qml/Shell.qml' | |||
128 | --- qml/Shell.qml 2015-07-29 12:38:53 +0000 | |||
129 | +++ qml/Shell.qml 2015-08-03 14:21:12 +0000 | |||
130 | @@ -191,12 +191,6 @@ | |||
131 | 191 | z: dialogs.z + 10 | 191 | z: dialogs.z + 10 |
132 | 192 | } | 192 | } |
133 | 193 | 193 | ||
134 | 194 | Binding { | ||
135 | 195 | target: ApplicationManager | ||
136 | 196 | property: "forceDashActive" | ||
137 | 197 | value: launcher.shown || launcher.dashSwipe | ||
138 | 198 | } | ||
139 | 199 | |||
140 | 200 | WindowKeysFilter { | 194 | WindowKeysFilter { |
141 | 201 | Keys.onPressed: physicalKeysMapper.onKeyPressed(event); | 195 | Keys.onPressed: physicalKeysMapper.onKeyPressed(event); |
142 | 202 | Keys.onReleased: physicalKeysMapper.onKeyReleased(event); | 196 | Keys.onReleased: physicalKeysMapper.onKeyReleased(event); |
143 | @@ -354,6 +348,16 @@ | |||
144 | 354 | } | 348 | } |
145 | 355 | Binding { | 349 | Binding { |
146 | 356 | target: applicationsDisplayLoader.item | 350 | target: applicationsDisplayLoader.item |
147 | 351 | property: "keepDashRunning" | ||
148 | 352 | value: launcher.shown || launcher.dashSwipe | ||
149 | 353 | } | ||
150 | 354 | Binding { | ||
151 | 355 | target: applicationsDisplayLoader.item | ||
152 | 356 | property: "suspended" | ||
153 | 357 | value: greeter.shown | ||
154 | 358 | } | ||
155 | 359 | Binding { | ||
156 | 360 | target: applicationsDisplayLoader.item | ||
157 | 357 | property: "altTabPressed" | 361 | property: "altTabPressed" |
158 | 358 | value: physicalKeysMapper.altTabPressed | 362 | value: physicalKeysMapper.altTabPressed |
159 | 359 | } | 363 | } |
160 | @@ -459,12 +463,6 @@ | |||
161 | 459 | } | 463 | } |
162 | 460 | 464 | ||
163 | 461 | onEmergencyCall: startLockedApp("dialer-app") | 465 | onEmergencyCall: startLockedApp("dialer-app") |
164 | 462 | |||
165 | 463 | Binding { | ||
166 | 464 | target: ApplicationManager | ||
167 | 465 | property: "suspended" | ||
168 | 466 | value: greeter.shown | ||
169 | 467 | } | ||
170 | 468 | } | 466 | } |
171 | 469 | } | 467 | } |
172 | 470 | 468 | ||
173 | 471 | 469 | ||
174 | === modified file 'qml/Stages/DesktopStage.qml' | |||
175 | --- qml/Stages/DesktopStage.qml 2015-07-16 15:26:26 +0000 | |||
176 | +++ qml/Stages/DesktopStage.qml 2015-08-03 14:21:12 +0000 | |||
177 | @@ -39,6 +39,8 @@ | |||
178 | 39 | property int shellPrimaryOrientation | 39 | property int shellPrimaryOrientation |
179 | 40 | property int nativeOrientation | 40 | property int nativeOrientation |
180 | 41 | property bool beingResized: false | 41 | property bool beingResized: false |
181 | 42 | property bool keepDashRunning: true | ||
182 | 43 | property bool suspended: false | ||
183 | 42 | 44 | ||
184 | 43 | // functions to be called from outside | 45 | // functions to be called from outside |
185 | 44 | function updateFocusedAppOrientation() { /* TODO */ } | 46 | function updateFocusedAppOrientation() { /* TODO */ } |
186 | @@ -215,6 +217,17 @@ | |||
187 | 215 | } | 217 | } |
188 | 216 | } | 218 | } |
189 | 217 | 219 | ||
190 | 220 | Binding { | ||
191 | 221 | target: ApplicationManager.get(index) | ||
192 | 222 | property: "requestedState" | ||
193 | 223 | // TODO: figure out some lifecycle policy, like suspending minimized apps | ||
194 | 224 | // if running on a tablet or something. | ||
195 | 225 | // TODO: If the device has a dozen suspended apps because it was running | ||
196 | 226 | // in staged mode, when it switches to Windowed mode it will suddenly | ||
197 | 227 | // resume all those apps at once. We might want to avoid that. | ||
198 | 228 | value: ApplicationInfoInterface.RequestedRunning // Always running for now | ||
199 | 229 | } | ||
200 | 230 | |||
201 | 218 | function maximize() { | 231 | function maximize() { |
202 | 219 | minimized = false; | 232 | minimized = false; |
203 | 220 | maximized = true; | 233 | maximized = true; |
204 | 221 | 234 | ||
205 | === modified file 'qml/Stages/PhoneStage.qml' | |||
206 | --- qml/Stages/PhoneStage.qml 2015-07-14 08:09:58 +0000 | |||
207 | +++ qml/Stages/PhoneStage.qml 2015-08-03 14:21:12 +0000 | |||
208 | @@ -36,6 +36,8 @@ | |||
209 | 36 | property bool altTabEnabled: true | 36 | property bool altTabEnabled: true |
210 | 37 | property real startScale: 1.1 | 37 | property real startScale: 1.1 |
211 | 38 | property real endScale: 0.7 | 38 | property real endScale: 0.7 |
212 | 39 | property bool keepDashRunning: true | ||
213 | 40 | property bool suspended: false | ||
214 | 39 | property int shellOrientationAngle: 0 | 41 | property int shellOrientationAngle: 0 |
215 | 40 | property int shellOrientation | 42 | property int shellOrientation |
216 | 41 | property int shellPrimaryOrientation | 43 | property int shellPrimaryOrientation |
217 | @@ -428,6 +430,14 @@ | |||
218 | 428 | dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated | 430 | dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated |
219 | 429 | focusFirstApp: root.focusFirstApp | 431 | focusFirstApp: root.focusFirstApp |
220 | 430 | 432 | ||
221 | 433 | Binding { | ||
222 | 434 | target: appDelegate.application | ||
223 | 435 | property: "requestedState" | ||
224 | 436 | value: (isDash && root.keepDashRunning) || (!root.suspended && appDelegate.focus) | ||
225 | 437 | ? ApplicationInfoInterface.RequestedRunning | ||
226 | 438 | : ApplicationInfoInterface.RequestedSuspended | ||
227 | 439 | } | ||
228 | 440 | |||
229 | 431 | readonly property bool isDash: model.appId == "unity8-dash" | 441 | readonly property bool isDash: model.appId == "unity8-dash" |
230 | 432 | 442 | ||
231 | 433 | z: isDash && !spreadView.active ? -1 : behavioredIndex | 443 | z: isDash && !spreadView.active ? -1 : behavioredIndex |
232 | 434 | 444 | ||
233 | === modified file 'qml/Stages/TabletStage.qml' | |||
234 | --- qml/Stages/TabletStage.qml 2015-07-06 09:31:43 +0000 | |||
235 | +++ qml/Stages/TabletStage.qml 2015-08-03 14:21:12 +0000 | |||
236 | @@ -36,6 +36,8 @@ | |||
237 | 36 | property bool spreadEnabled: true // If false, animations and right edge will be disabled | 36 | property bool spreadEnabled: true // If false, animations and right edge will be disabled |
238 | 37 | 37 | ||
239 | 38 | property real inverseProgress: 0 // This is the progress for left edge drags, in pixels. | 38 | property real inverseProgress: 0 // This is the progress for left edge drags, in pixels. |
240 | 39 | property bool keepDashRunning: true | ||
241 | 40 | property bool suspended: false | ||
242 | 39 | property int shellOrientationAngle: 0 | 41 | property int shellOrientationAngle: 0 |
243 | 40 | property int shellOrientation | 42 | property int shellOrientation |
244 | 41 | property int shellPrimaryOrientation | 43 | property int shellPrimaryOrientation |
245 | @@ -117,6 +119,7 @@ | |||
246 | 117 | 119 | ||
247 | 118 | QtObject { | 120 | QtObject { |
248 | 119 | id: priv | 121 | id: priv |
249 | 122 | objectName: "stagesPriv" | ||
250 | 120 | 123 | ||
251 | 121 | property string focusedAppId: ApplicationManager.focusedApplicationId | 124 | property string focusedAppId: ApplicationManager.focusedApplicationId |
252 | 122 | readonly property var focusedAppDelegate: { | 125 | readonly property var focusedAppDelegate: { |
253 | @@ -626,6 +629,17 @@ | |||
254 | 626 | 629 | ||
255 | 627 | readonly property bool isDash: model.appId == "unity8-dash" | 630 | readonly property bool isDash: model.appId == "unity8-dash" |
256 | 628 | 631 | ||
257 | 632 | Binding { | ||
258 | 633 | target: spreadTile.application | ||
259 | 634 | property: "requestedState" | ||
260 | 635 | value: (spreadTile.isDash && root.keepDashRunning) | ||
261 | 636 | || | ||
262 | 637 | (!root.suspended && (model.appId == priv.mainStageAppId | ||
263 | 638 | || model.appId == priv.sideStageAppId)) | ||
264 | 639 | ? ApplicationInfoInterface.RequestedRunning | ||
265 | 640 | : ApplicationInfoInterface.RequestedSuspended | ||
266 | 641 | } | ||
267 | 642 | |||
268 | 629 | // FIXME: A regular binding doesn't update any more after closing an app. | 643 | // FIXME: A regular binding doesn't update any more after closing an app. |
269 | 630 | // Using a Binding for now. | 644 | // Using a Binding for now. |
270 | 631 | Binding { | 645 | Binding { |
271 | 632 | 646 | ||
272 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.cpp' | |||
273 | --- tests/mocks/Unity/Application/ApplicationInfo.cpp 2015-03-06 04:44:11 +0000 | |||
274 | +++ tests/mocks/Unity/Application/ApplicationInfo.cpp 2015-08-03 14:21:12 +0000 | |||
275 | @@ -30,7 +30,7 @@ | |||
276 | 30 | : ApplicationInfoInterface(appId, parent) | 30 | : ApplicationInfoInterface(appId, parent) |
277 | 31 | , m_appId(appId) | 31 | , m_appId(appId) |
278 | 32 | , m_stage(MainStage) | 32 | , m_stage(MainStage) |
280 | 33 | , m_state(Starting) | 33 | , m_state(Stopped) |
281 | 34 | , m_focused(false) | 34 | , m_focused(false) |
282 | 35 | , m_fullscreen(false) | 35 | , m_fullscreen(false) |
283 | 36 | , m_session(0) | 36 | , m_session(0) |
284 | @@ -39,6 +39,7 @@ | |||
285 | 39 | Qt::InvertedPortraitOrientation | | 39 | Qt::InvertedPortraitOrientation | |
286 | 40 | Qt::InvertedLandscapeOrientation) | 40 | Qt::InvertedLandscapeOrientation) |
287 | 41 | , m_rotatesWindowContents(false) | 41 | , m_rotatesWindowContents(false) |
288 | 42 | , m_requestedState(RequestedRunning) | ||
289 | 42 | , m_manualSurfaceCreation(false) | 43 | , m_manualSurfaceCreation(false) |
290 | 43 | { | 44 | { |
291 | 44 | } | 45 | } |
292 | @@ -46,7 +47,7 @@ | |||
293 | 46 | ApplicationInfo::ApplicationInfo(QObject *parent) | 47 | ApplicationInfo::ApplicationInfo(QObject *parent) |
294 | 47 | : ApplicationInfoInterface(QString(), parent) | 48 | : ApplicationInfoInterface(QString(), parent) |
295 | 48 | , m_stage(MainStage) | 49 | , m_stage(MainStage) |
297 | 49 | , m_state(Starting) | 50 | , m_state(Stopped) |
298 | 50 | , m_focused(false) | 51 | , m_focused(false) |
299 | 51 | , m_fullscreen(false) | 52 | , m_fullscreen(false) |
300 | 52 | , m_session(0) | 53 | , m_session(0) |
301 | @@ -55,6 +56,7 @@ | |||
302 | 55 | Qt::InvertedPortraitOrientation | | 56 | Qt::InvertedPortraitOrientation | |
303 | 56 | Qt::InvertedLandscapeOrientation) | 57 | Qt::InvertedLandscapeOrientation) |
304 | 57 | , m_rotatesWindowContents(false) | 58 | , m_rotatesWindowContents(false) |
305 | 59 | , m_requestedState(RequestedRunning) | ||
306 | 58 | , m_manualSurfaceCreation(false) | 60 | , m_manualSurfaceCreation(false) |
307 | 59 | { | 61 | { |
308 | 60 | } | 62 | } |
309 | @@ -74,7 +76,6 @@ | |||
310 | 74 | 76 | ||
311 | 75 | void ApplicationInfo::setSession(Session* session) | 77 | void ApplicationInfo::setSession(Session* session) |
312 | 76 | { | 78 | { |
313 | 77 | qDebug() << "Application::setSession - appId=" << appId() << "session=" << session; | ||
314 | 78 | if (m_session == session) | 79 | if (m_session == session) |
315 | 79 | return; | 80 | return; |
316 | 80 | 81 | ||
317 | @@ -91,6 +92,8 @@ | |||
318 | 91 | m_session->setApplication(this); | 92 | m_session->setApplication(this); |
319 | 92 | m_session->setParent(this); | 93 | m_session->setParent(this); |
320 | 93 | SessionManager::singleton()->registerSession(m_session); | 94 | SessionManager::singleton()->registerSession(m_session); |
321 | 95 | connect(m_session, &Session::surfaceChanged, | ||
322 | 96 | this, &ApplicationInfo::onSessionSurfaceChanged); | ||
323 | 94 | 97 | ||
324 | 95 | if (!m_manualSurfaceCreation) { | 98 | if (!m_manualSurfaceCreation) { |
325 | 96 | QTimer::singleShot(500, m_session, SLOT(createSurface())); | 99 | QTimer::singleShot(500, m_session, SLOT(createSurface())); |
326 | @@ -161,11 +164,12 @@ | |||
327 | 161 | m_state = value; | 164 | m_state = value; |
328 | 162 | Q_EMIT stateChanged(value); | 165 | Q_EMIT stateChanged(value); |
329 | 163 | 166 | ||
331 | 164 | if (!m_manualSurfaceCreation && m_state == ApplicationInfo::Running) { | 167 | if (!m_manualSurfaceCreation && !m_session && m_state == ApplicationInfo::Starting) { |
332 | 165 | QTimer::singleShot(500, this, SLOT(createSession())); | 168 | QTimer::singleShot(500, this, SLOT(createSession())); |
333 | 166 | } else if (m_state == ApplicationInfo::Stopped) { | 169 | } else if (m_state == ApplicationInfo::Stopped) { |
336 | 167 | delete m_session; | 170 | Session *session = m_session; |
337 | 168 | m_session = nullptr; | 171 | setSession(nullptr); |
338 | 172 | delete session; | ||
339 | 169 | } | 173 | } |
340 | 170 | } | 174 | } |
341 | 171 | } | 175 | } |
342 | @@ -213,3 +217,33 @@ | |||
343 | 213 | { | 217 | { |
344 | 214 | m_rotatesWindowContents = value; | 218 | m_rotatesWindowContents = value; |
345 | 215 | } | 219 | } |
346 | 220 | |||
347 | 221 | ApplicationInfo::RequestedState ApplicationInfo::requestedState() const | ||
348 | 222 | { | ||
349 | 223 | return m_requestedState; | ||
350 | 224 | } | ||
351 | 225 | |||
352 | 226 | void ApplicationInfo::setRequestedState(RequestedState value) | ||
353 | 227 | { | ||
354 | 228 | if (m_requestedState != value) { | ||
355 | 229 | m_requestedState = value; | ||
356 | 230 | Q_EMIT requestedStateChanged(m_requestedState); | ||
357 | 231 | |||
358 | 232 | if (m_requestedState == RequestedRunning && m_state == Suspended) { | ||
359 | 233 | setState(Running); | ||
360 | 234 | } else if (m_requestedState == RequestedSuspended && m_state == Running) { | ||
361 | 235 | setState(Suspended); | ||
362 | 236 | } | ||
363 | 237 | } | ||
364 | 238 | } | ||
365 | 239 | |||
366 | 240 | void ApplicationInfo::onSessionSurfaceChanged(MirSurfaceItem* surface) | ||
367 | 241 | { | ||
368 | 242 | if (surface != nullptr && m_state == Starting) { | ||
369 | 243 | if (m_requestedState == RequestedRunning) { | ||
370 | 244 | setState(Running); | ||
371 | 245 | } else { | ||
372 | 246 | setState(Suspended); | ||
373 | 247 | } | ||
374 | 248 | } | ||
375 | 249 | } | ||
376 | 216 | 250 | ||
377 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.h' | |||
378 | --- tests/mocks/Unity/Application/ApplicationInfo.h 2015-03-06 04:44:11 +0000 | |||
379 | +++ tests/mocks/Unity/Application/ApplicationInfo.h 2015-08-03 14:21:12 +0000 | |||
380 | @@ -46,6 +46,9 @@ | |||
381 | 46 | ApplicationInfo(const QString &appId, QObject *parent = nullptr); | 46 | ApplicationInfo(const QString &appId, QObject *parent = nullptr); |
382 | 47 | ~ApplicationInfo(); | 47 | ~ApplicationInfo(); |
383 | 48 | 48 | ||
384 | 49 | RequestedState requestedState() const override; | ||
385 | 50 | void setRequestedState(RequestedState) override; | ||
386 | 51 | |||
387 | 49 | void setIconId(const QString &iconId); | 52 | void setIconId(const QString &iconId); |
388 | 50 | void setScreenshotId(const QString &screenshotId); | 53 | void setScreenshotId(const QString &screenshotId); |
389 | 51 | 54 | ||
390 | @@ -101,6 +104,9 @@ | |||
391 | 101 | public Q_SLOTS: | 104 | public Q_SLOTS: |
392 | 102 | Q_INVOKABLE void createSession(); | 105 | Q_INVOKABLE void createSession(); |
393 | 103 | 106 | ||
394 | 107 | private Q_SLOTS: | ||
395 | 108 | void onSessionSurfaceChanged(MirSurfaceItem*); | ||
396 | 109 | |||
397 | 104 | private: | 110 | private: |
398 | 105 | void setIcon(const QUrl &value); | 111 | void setIcon(const QUrl &value); |
399 | 106 | 112 | ||
400 | @@ -116,6 +122,7 @@ | |||
401 | 116 | Session* m_session; | 122 | Session* m_session; |
402 | 117 | Qt::ScreenOrientations m_supportedOrientations; | 123 | Qt::ScreenOrientations m_supportedOrientations; |
403 | 118 | bool m_rotatesWindowContents; | 124 | bool m_rotatesWindowContents; |
404 | 125 | RequestedState m_requestedState; | ||
405 | 119 | 126 | ||
406 | 120 | bool m_manualSurfaceCreation; | 127 | bool m_manualSurfaceCreation; |
407 | 121 | }; | 128 | }; |
408 | 122 | 129 | ||
409 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp' | |||
410 | --- tests/mocks/Unity/Application/ApplicationManager.cpp 2015-06-24 11:41:09 +0000 | |||
411 | +++ tests/mocks/Unity/Application/ApplicationManager.cpp 2015-08-03 14:21:12 +0000 | |||
412 | @@ -49,8 +49,6 @@ | |||
413 | 49 | 49 | ||
414 | 50 | ApplicationManager::ApplicationManager(QObject *parent) | 50 | ApplicationManager::ApplicationManager(QObject *parent) |
415 | 51 | : ApplicationManagerInterface(parent) | 51 | : ApplicationManagerInterface(parent) |
416 | 52 | , m_suspended(false) | ||
417 | 53 | , m_forceDashActive(false) | ||
418 | 54 | { | 52 | { |
419 | 55 | m_roleNames.insert(RoleSession, "session"); | 53 | m_roleNames.insert(RoleSession, "session"); |
420 | 56 | m_roleNames.insert(RoleFullscreen, "fullscreen"); | 54 | m_roleNames.insert(RoleFullscreen, "fullscreen"); |
421 | @@ -217,7 +215,7 @@ | |||
422 | 217 | && application->stage() == ApplicationInfo::SideStage) { | 215 | && application->stage() == ApplicationInfo::SideStage) { |
423 | 218 | application->setStage(ApplicationInfo::MainStage); | 216 | application->setStage(ApplicationInfo::MainStage); |
424 | 219 | } | 217 | } |
426 | 220 | application->setState(ApplicationInfo::Running); | 218 | application->setState(ApplicationInfo::Starting); |
427 | 221 | 219 | ||
428 | 222 | return application; | 220 | return application; |
429 | 223 | } | 221 | } |
430 | @@ -262,50 +260,6 @@ | |||
431 | 262 | return QString(); | 260 | return QString(); |
432 | 263 | } | 261 | } |
433 | 264 | 262 | ||
434 | 265 | bool ApplicationManager::suspended() const | ||
435 | 266 | { | ||
436 | 267 | return m_suspended; | ||
437 | 268 | } | ||
438 | 269 | |||
439 | 270 | void ApplicationManager::setSuspended(bool suspended) | ||
440 | 271 | { | ||
441 | 272 | ApplicationInfo *focusedApp = findApplication(focusedApplicationId()); | ||
442 | 273 | if (focusedApp) { | ||
443 | 274 | if (suspended) { | ||
444 | 275 | focusedApp->setState(ApplicationInfo::Suspended); | ||
445 | 276 | } else { | ||
446 | 277 | focusedApp->setState(ApplicationInfo::Running); | ||
447 | 278 | } | ||
448 | 279 | } | ||
449 | 280 | m_suspended = suspended; | ||
450 | 281 | Q_EMIT suspendedChanged(); | ||
451 | 282 | } | ||
452 | 283 | |||
453 | 284 | bool ApplicationManager::forceDashActive() const | ||
454 | 285 | { | ||
455 | 286 | return m_forceDashActive; | ||
456 | 287 | } | ||
457 | 288 | |||
458 | 289 | void ApplicationManager::setForceDashActive(bool forceDashActive) | ||
459 | 290 | { | ||
460 | 291 | if (m_forceDashActive == forceDashActive) { | ||
461 | 292 | return; | ||
462 | 293 | } | ||
463 | 294 | |||
464 | 295 | ApplicationInfo *dash = findApplication("unity8-dash"); | ||
465 | 296 | if (dash) { | ||
466 | 297 | if (forceDashActive) { | ||
467 | 298 | dash->setState(ApplicationInfo::Running); | ||
468 | 299 | } else { | ||
469 | 300 | if (!dash->focused()) { | ||
470 | 301 | dash->setState(ApplicationInfo::Suspended); | ||
471 | 302 | } | ||
472 | 303 | } | ||
473 | 304 | } | ||
474 | 305 | m_forceDashActive = forceDashActive; | ||
475 | 306 | Q_EMIT forceDashActiveChanged(); | ||
476 | 307 | } | ||
477 | 308 | |||
478 | 309 | bool ApplicationManager::focusApplication(const QString &appId) | 263 | bool ApplicationManager::focusApplication(const QString &appId) |
479 | 310 | { | 264 | { |
480 | 311 | ApplicationInfo *application = findApplication(appId); | 265 | ApplicationInfo *application = findApplication(appId); |
481 | @@ -316,13 +270,11 @@ | |||
482 | 316 | for (ApplicationInfo *app : m_runningApplications) { | 270 | for (ApplicationInfo *app : m_runningApplications) { |
483 | 317 | if (app->focused()) { | 271 | if (app->focused()) { |
484 | 318 | app->setFocused(false); | 272 | app->setFocused(false); |
485 | 319 | app->setState(ApplicationInfo::Suspended); | ||
486 | 320 | } | 273 | } |
487 | 321 | } | 274 | } |
488 | 322 | 275 | ||
489 | 323 | // focus this app | 276 | // focus this app |
490 | 324 | application->setFocused(true); | 277 | application->setFocused(true); |
491 | 325 | application->setState(ApplicationInfo::Running); | ||
492 | 326 | 278 | ||
493 | 327 | // move app to top of stack | 279 | // move app to top of stack |
494 | 328 | move(m_runningApplications.indexOf(application), 0); | 280 | move(m_runningApplications.indexOf(application), 0); |
495 | @@ -394,6 +346,7 @@ | |||
496 | 394 | application->setScreenshotId("gallery"); | 346 | application->setScreenshotId("gallery"); |
497 | 395 | application->setIconId("gallery"); | 347 | application->setIconId("gallery"); |
498 | 396 | application->setFullscreen(true); | 348 | application->setFullscreen(true); |
499 | 349 | application->setStage(ApplicationInfo::MainStage); | ||
500 | 397 | m_availableApplications.append(application); | 350 | m_availableApplications.append(application); |
501 | 398 | 351 | ||
502 | 399 | application = new ApplicationInfo(this); | 352 | application = new ApplicationInfo(this); |
503 | 400 | 353 | ||
504 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.h' | |||
505 | --- tests/mocks/Unity/Application/ApplicationManager.h 2015-04-01 11:25:54 +0000 | |||
506 | +++ tests/mocks/Unity/Application/ApplicationManager.h 2015-08-03 14:21:12 +0000 | |||
507 | @@ -69,11 +69,6 @@ | |||
508 | 69 | Q_INVOKABLE bool stopApplication(const QString &appId) override; | 69 | Q_INVOKABLE bool stopApplication(const QString &appId) override; |
509 | 70 | 70 | ||
510 | 71 | QString focusedApplicationId() const override; | 71 | QString focusedApplicationId() const override; |
511 | 72 | bool suspended() const override; | ||
512 | 73 | void setSuspended(bool suspended) override; | ||
513 | 74 | |||
514 | 75 | bool forceDashActive() const override; | ||
515 | 76 | void setForceDashActive(bool forceDashActive) override; | ||
516 | 77 | 72 | ||
517 | 78 | // Only for testing | 73 | // Only for testing |
518 | 79 | QStringList availableApplications(); | 74 | QStringList availableApplications(); |
519 | @@ -96,8 +91,6 @@ | |||
520 | 96 | void remove(ApplicationInfo* application); | 91 | void remove(ApplicationInfo* application); |
521 | 97 | void buildListOfAvailableApplications(); | 92 | void buildListOfAvailableApplications(); |
522 | 98 | void onWindowCreated(); | 93 | void onWindowCreated(); |
523 | 99 | bool m_suspended; | ||
524 | 100 | bool m_forceDashActive; | ||
525 | 101 | QList<ApplicationInfo*> m_runningApplications; | 94 | QList<ApplicationInfo*> m_runningApplications; |
526 | 102 | QList<ApplicationInfo*> m_availableApplications; | 95 | QList<ApplicationInfo*> m_availableApplications; |
527 | 103 | QTimer m_windowCreatedTimer; | 96 | QTimer m_windowCreatedTimer; |
528 | 104 | 97 | ||
529 | === modified file 'tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt' | |||
530 | --- tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt 2015-07-23 10:31:56 +0000 | |||
531 | +++ tests/plugins/Greeter/Unity/Launcher/CMakeLists.txt 2015-08-03 14:21:12 +0000 | |||
532 | @@ -1,5 +1,4 @@ | |||
533 | 1 | pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7) | 1 | pkg_check_modules(LAUNCHER_API REQUIRED unity-shell-launcher=7) |
534 | 2 | pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=6) | ||
535 | 3 | 2 | ||
536 | 4 | include_directories( | 3 | include_directories( |
537 | 5 | ${CMAKE_CURRENT_SOURCE_DIR} | 4 | ${CMAKE_CURRENT_SOURCE_DIR} |
538 | 6 | 5 | ||
539 | === modified file 'tests/plugins/Unity/Launcher/launchermodeltest.cpp' | |||
540 | --- tests/plugins/Unity/Launcher/launchermodeltest.cpp 2015-07-23 14:13:57 +0000 | |||
541 | +++ tests/plugins/Unity/Launcher/launchermodeltest.cpp 2015-08-03 14:21:12 +0000 | |||
542 | @@ -39,6 +39,9 @@ | |||
543 | 39 | Q_OBJECT | 39 | Q_OBJECT |
544 | 40 | public: | 40 | public: |
545 | 41 | MockApp(const QString &appId, QObject *parent = 0): ApplicationInfoInterface(appId, parent), m_appId(appId), m_focused(false) { } | 41 | MockApp(const QString &appId, QObject *parent = 0): ApplicationInfoInterface(appId, parent), m_appId(appId), m_focused(false) { } |
546 | 42 | |||
547 | 43 | RequestedState requestedState() const override { return RequestedRunning; } | ||
548 | 44 | void setRequestedState(RequestedState) override {} | ||
549 | 42 | QString appId() const override { return m_appId; } | 45 | QString appId() const override { return m_appId; } |
550 | 43 | QString name() const override { return "mock"; } | 46 | QString name() const override { return "mock"; } |
551 | 44 | QString comment() const override { return "this is a mock"; } | 47 | QString comment() const override { return "this is a mock"; } |
552 | @@ -117,10 +120,6 @@ | |||
553 | 117 | endRemoveRows(); | 120 | endRemoveRows(); |
554 | 118 | } | 121 | } |
555 | 119 | bool requestFocusApplication(const QString &appId) override { Q_UNUSED(appId); return true; } | 122 | bool requestFocusApplication(const QString &appId) override { Q_UNUSED(appId); return true; } |
556 | 120 | bool suspended() const override { return false; } | ||
557 | 121 | void setSuspended(bool) override {} | ||
558 | 122 | bool forceDashActive() const override { return false; } | ||
559 | 123 | void setForceDashActive(bool) override {} | ||
560 | 124 | 123 | ||
561 | 125 | private: | 124 | private: |
562 | 126 | QList<MockApp*> m_list; | 125 | QList<MockApp*> m_list; |
563 | 127 | 126 | ||
564 | === modified file 'tests/qmltests/Stages/ApplicationCheckBox.qml' | |||
565 | --- tests/qmltests/Stages/ApplicationCheckBox.qml 2015-06-12 16:07:43 +0000 | |||
566 | +++ tests/qmltests/Stages/ApplicationCheckBox.qml 2015-08-03 14:21:12 +0000 | |||
567 | @@ -86,8 +86,29 @@ | |||
568 | 86 | } | 86 | } |
569 | 87 | } | 87 | } |
570 | 88 | Label { | 88 | Label { |
571 | 89 | id: appIdLabel | ||
572 | 89 | text: root.appId | 90 | text: root.appId |
573 | 90 | color: "white" | 91 | color: "white" |
574 | 91 | anchors.verticalCenter: parent.verticalCenter | 92 | anchors.verticalCenter: parent.verticalCenter |
575 | 92 | } | 93 | } |
576 | 94 | Rectangle { | ||
577 | 95 | color: { | ||
578 | 96 | if (d.application) { | ||
579 | 97 | if (d.application.state === ApplicationInfoInterface.Starting) { | ||
580 | 98 | return "yellow"; | ||
581 | 99 | } else if (d.application.state === ApplicationInfoInterface.Running) { | ||
582 | 100 | return "green"; | ||
583 | 101 | } else if (d.application.state === ApplicationInfoInterface.Suspended) { | ||
584 | 102 | return "blue"; | ||
585 | 103 | } else { | ||
586 | 104 | return "darkred"; | ||
587 | 105 | } | ||
588 | 106 | } else { | ||
589 | 107 | return "darkred"; | ||
590 | 108 | } | ||
591 | 109 | } | ||
592 | 110 | width: height | ||
593 | 111 | height: appIdLabel.height * 0.7 | ||
594 | 112 | anchors.verticalCenter: parent.verticalCenter | ||
595 | 113 | } | ||
596 | 93 | } | 114 | } |
597 | 94 | 115 | ||
598 | === modified file 'tests/qmltests/Stages/tst_DesktopStage.qml' | |||
599 | --- tests/qmltests/Stages/tst_DesktopStage.qml 2015-05-01 13:21:30 +0000 | |||
600 | +++ tests/qmltests/Stages/tst_DesktopStage.qml 2015-08-03 14:21:12 +0000 | |||
601 | @@ -24,9 +24,8 @@ | |||
602 | 24 | 24 | ||
603 | 25 | import "../../../qml/Stages" | 25 | import "../../../qml/Stages" |
604 | 26 | 26 | ||
606 | 27 | Rectangle { | 27 | Item { |
607 | 28 | id: root | 28 | id: root |
608 | 29 | color: "darkblue" | ||
609 | 30 | width: desktopStageLoader.width + controls.width | 29 | width: desktopStageLoader.width + controls.width |
610 | 31 | height: desktopStageLoader.height | 30 | height: desktopStageLoader.height |
611 | 32 | 31 | ||
612 | @@ -57,6 +56,7 @@ | |||
613 | 57 | property bool itemDestroyed: false | 56 | property bool itemDestroyed: false |
614 | 58 | sourceComponent: Component { | 57 | sourceComponent: Component { |
615 | 59 | DesktopStage { | 58 | DesktopStage { |
616 | 59 | color: "darkblue" | ||
617 | 60 | anchors.fill: parent | 60 | anchors.fill: parent |
618 | 61 | Component.onDestruction: { | 61 | Component.onDestruction: { |
619 | 62 | desktopStageLoader.itemDestroyed = true; | 62 | desktopStageLoader.itemDestroyed = true; |
620 | 63 | 63 | ||
621 | === modified file 'tests/qmltests/Stages/tst_PhoneStage.qml' | |||
622 | --- tests/qmltests/Stages/tst_PhoneStage.qml 2015-06-23 14:20:23 +0000 | |||
623 | +++ tests/qmltests/Stages/tst_PhoneStage.qml 2015-08-03 14:21:12 +0000 | |||
624 | @@ -301,16 +301,16 @@ | |||
625 | 301 | addApps(2); | 301 | addApps(2); |
626 | 302 | 302 | ||
627 | 303 | var secondApp = ApplicationManager.get(0); | 303 | var secondApp = ApplicationManager.get(0); |
629 | 304 | tryCompare(secondApp, "state", ApplicationInfoInterface.Running); | 304 | tryCompare(secondApp, "requestedState", ApplicationInfoInterface.RequestedRunning); |
630 | 305 | tryCompare(secondApp, "focused", true); | 305 | tryCompare(secondApp, "focused", true); |
631 | 306 | 306 | ||
632 | 307 | var firstApp = ApplicationManager.get(1); | 307 | var firstApp = ApplicationManager.get(1); |
634 | 308 | tryCompare(firstApp, "state", ApplicationInfoInterface.Suspended); | 308 | tryCompare(firstApp, "requestedState", ApplicationInfoInterface.RequestedSuspended); |
635 | 309 | tryCompare(firstApp, "focused", false); | 309 | tryCompare(firstApp, "focused", false); |
636 | 310 | 310 | ||
637 | 311 | ApplicationManager.stopApplication(secondApp.appId); | 311 | ApplicationManager.stopApplication(secondApp.appId); |
638 | 312 | 312 | ||
640 | 313 | tryCompare(firstApp, "state", ApplicationInfoInterface.Running); | 313 | tryCompare(firstApp, "requestedState", ApplicationInfoInterface.RequestedRunning); |
641 | 314 | tryCompare(firstApp, "focused", true); | 314 | tryCompare(firstApp, "focused", true); |
642 | 315 | } | 315 | } |
643 | 316 | 316 | ||
644 | @@ -388,5 +388,77 @@ | |||
645 | 388 | 388 | ||
646 | 389 | tryCompare(focusedDelegate, "x", 0); | 389 | tryCompare(focusedDelegate, "x", 0); |
647 | 390 | } | 390 | } |
648 | 391 | |||
649 | 392 | function test_focusedAppIsTheOnlyRunningApp() { | ||
650 | 393 | addApps(2); | ||
651 | 394 | |||
652 | 395 | var delegateA = findChild(phoneStage, "appDelegate0"); | ||
653 | 396 | verify(delegateA); | ||
654 | 397 | var delegateB = findChild(phoneStage, "appDelegate1"); | ||
655 | 398 | verify(delegateB); | ||
656 | 399 | |||
657 | 400 | // A is focused and running, B is unfocused and suspended | ||
658 | 401 | compare(delegateA.focus, true); | ||
659 | 402 | compare(delegateA.application.requestedState, ApplicationInfoInterface.RequestedRunning); | ||
660 | 403 | compare(delegateB.focus, false); | ||
661 | 404 | compare(delegateB.application.requestedState, ApplicationInfoInterface.RequestedSuspended); | ||
662 | 405 | |||
663 | 406 | // Switch foreground/focused appp from A to B | ||
664 | 407 | goToSpread(); | ||
665 | 408 | phoneStage.select(delegateB.application.appId); | ||
666 | 409 | |||
667 | 410 | // Now it's the other way round | ||
668 | 411 | // A is unfocused and suspended, B is focused and running | ||
669 | 412 | tryCompare(delegateA, "focus", false); | ||
670 | 413 | tryCompare(delegateA.application, "requestedState", ApplicationInfoInterface.RequestedSuspended); | ||
671 | 414 | tryCompare(delegateB, "focus", true); | ||
672 | 415 | tryCompare(delegateB.application, "requestedState", ApplicationInfoInterface.RequestedRunning); | ||
673 | 416 | } | ||
674 | 417 | |||
675 | 418 | function test_dashRemainsRunningIfStageIsToldSo() { | ||
676 | 419 | addApps(1); | ||
677 | 420 | |||
678 | 421 | var delegateDash = findChild(phoneStage, "appDelegate1"); | ||
679 | 422 | verify(delegateDash); | ||
680 | 423 | compare(delegateDash.application.appId, "unity8-dash"); | ||
681 | 424 | |||
682 | 425 | var delegateOther = findChild(phoneStage, "appDelegate0"); | ||
683 | 426 | verify(delegateOther); | ||
684 | 427 | |||
685 | 428 | goToSpread(); | ||
686 | 429 | phoneStage.select("unity8-dash"); | ||
687 | 430 | |||
688 | 431 | tryCompare(delegateDash, "focus", true); | ||
689 | 432 | tryCompare(delegateDash.application, "requestedState", ApplicationInfoInterface.RequestedRunning); | ||
690 | 433 | compare(delegateOther.focus, false); | ||
691 | 434 | compare(delegateOther.application.requestedState, ApplicationInfoInterface.RequestedSuspended); | ||
692 | 435 | |||
693 | 436 | goToSpread(); | ||
694 | 437 | phoneStage.select(delegateOther.application.appId); | ||
695 | 438 | |||
696 | 439 | // The other app gets focused and running but dash is kept running despite being unfocused | ||
697 | 440 | tryCompare(delegateDash, "focus", false); | ||
698 | 441 | tryCompare(delegateDash.application, "requestedState", ApplicationInfoInterface.RequestedRunning); | ||
699 | 442 | compare(delegateOther.focus, true); | ||
700 | 443 | compare(delegateOther.application.requestedState, ApplicationInfoInterface.RequestedRunning); | ||
701 | 444 | } | ||
702 | 445 | |||
703 | 446 | function test_foregroundAppIsSuspendedWhenStageIsSuspended() { | ||
704 | 447 | addApps(1); | ||
705 | 448 | |||
706 | 449 | var delegate = findChild(phoneStage, "appDelegate0"); | ||
707 | 450 | verify(delegate); | ||
708 | 451 | |||
709 | 452 | compare(delegate.focus, true); | ||
710 | 453 | compare(delegate.application.requestedState, ApplicationInfoInterface.RequestedRunning); | ||
711 | 454 | |||
712 | 455 | phoneStage.suspended = true; | ||
713 | 456 | |||
714 | 457 | tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedSuspended); | ||
715 | 458 | |||
716 | 459 | phoneStage.suspended = false; | ||
717 | 460 | |||
718 | 461 | tryCompare(delegate.application, "requestedState", ApplicationInfoInterface.RequestedRunning); | ||
719 | 462 | } | ||
720 | 391 | } | 463 | } |
721 | 392 | } | 464 | } |
722 | 393 | 465 | ||
723 | === modified file 'tests/qmltests/Stages/tst_TabletStage.qml' | |||
724 | --- tests/qmltests/Stages/tst_TabletStage.qml 2015-06-12 16:07:43 +0000 | |||
725 | +++ tests/qmltests/Stages/tst_TabletStage.qml 2015-08-03 14:21:12 +0000 | |||
726 | @@ -77,9 +77,17 @@ | |||
727 | 77 | appId: "webbrowser-app" | 77 | appId: "webbrowser-app" |
728 | 78 | } | 78 | } |
729 | 79 | ApplicationCheckBox { | 79 | ApplicationCheckBox { |
730 | 80 | id: galleryCheckBox | ||
731 | 81 | appId: "gallery-app" | ||
732 | 82 | } | ||
733 | 83 | ApplicationCheckBox { | ||
734 | 80 | id: dialerCheckBox | 84 | id: dialerCheckBox |
735 | 81 | appId: "dialer-app" | 85 | appId: "dialer-app" |
736 | 82 | } | 86 | } |
737 | 87 | ApplicationCheckBox { | ||
738 | 88 | id: facebookCheckBox | ||
739 | 89 | appId: "facebook-webapp" | ||
740 | 90 | } | ||
741 | 83 | } | 91 | } |
742 | 84 | } | 92 | } |
743 | 85 | 93 | ||
744 | @@ -93,6 +101,19 @@ | |||
745 | 93 | function init() { | 101 | function init() { |
746 | 94 | tabletStageLoader.active = true; | 102 | tabletStageLoader.active = true; |
747 | 95 | tryCompare(tabletStageLoader, "status", Loader.Ready); | 103 | tryCompare(tabletStageLoader, "status", Loader.Ready); |
748 | 104 | |||
749 | 105 | // this is very strange, but sometimes the test starts without | ||
750 | 106 | // TabletStage components having finished loading themselves | ||
751 | 107 | var appWindow = null; | ||
752 | 108 | while (!appWindow) { | ||
753 | 109 | appWindow = findChild(tabletStage, "appWindow_unity8-dash"); | ||
754 | 110 | if (!appWindow) { | ||
755 | 111 | console.log("didn't find appWindow_unity8-dash in " + tabletStage + ". Trying again..."); | ||
756 | 112 | wait(50); | ||
757 | 113 | } | ||
758 | 114 | } | ||
759 | 115 | |||
760 | 116 | waitUntilAppSurfaceShowsUp("unity8-dash"); | ||
761 | 96 | } | 117 | } |
762 | 97 | 118 | ||
763 | 98 | function cleanup() { | 119 | function cleanup() { |
764 | @@ -109,7 +130,9 @@ | |||
765 | 109 | 130 | ||
766 | 110 | // kill all (fake) running apps | 131 | // kill all (fake) running apps |
767 | 111 | webbrowserCheckBox.checked = false; | 132 | webbrowserCheckBox.checked = false; |
768 | 133 | galleryCheckBox.checked = false; | ||
769 | 112 | dialerCheckBox.checked = false; | 134 | dialerCheckBox.checked = false; |
770 | 135 | facebookCheckBox.checked = false; | ||
771 | 113 | } | 136 | } |
772 | 114 | 137 | ||
773 | 115 | function waitUntilAppSurfaceShowsUp(appId) { | 138 | function waitUntilAppSurfaceShowsUp(appId) { |
774 | @@ -120,6 +143,34 @@ | |||
775 | 120 | tryCompare(appWindowStates, "state", "surface"); | 143 | tryCompare(appWindowStates, "state", "surface"); |
776 | 121 | } | 144 | } |
777 | 122 | 145 | ||
778 | 146 | function switchToApp(targetAppId) { | ||
779 | 147 | touchFlick(tabletStage, | ||
780 | 148 | tabletStage.width - (tabletStage.dragAreaWidth / 2), tabletStage.height / 2, | ||
781 | 149 | tabletStage.x + 1, tabletStage.height / 2); | ||
782 | 150 | |||
783 | 151 | var spreadView = findChild(tabletStage, "spreadView"); | ||
784 | 152 | verify(spreadView); | ||
785 | 153 | tryCompare(spreadView, "phase", 2); | ||
786 | 154 | tryCompare(spreadView, "flicking", false); | ||
787 | 155 | tryCompare(spreadView, "moving", false); | ||
788 | 156 | |||
789 | 157 | waitUntilAppDelegateStopsMoving(targetAppId); | ||
790 | 158 | |||
791 | 159 | var targetAppWindow = findChild(tabletStage, "appWindow_" + targetAppId); | ||
792 | 160 | tap(targetAppWindow, 10, 10); | ||
793 | 161 | } | ||
794 | 162 | |||
795 | 163 | function waitUntilAppDelegateStopsMoving(targetAppId) | ||
796 | 164 | { | ||
797 | 165 | var targetAppDelegate = findChild(tabletStage, "tabletSpreadDelegate_" + targetAppId); | ||
798 | 166 | verify(targetAppDelegate); | ||
799 | 167 | var lastValue = undefined; | ||
800 | 168 | do { | ||
801 | 169 | lastValue = targetAppDelegate.animatedProgress; | ||
802 | 170 | wait(30); | ||
803 | 171 | } while (lastValue != targetAppDelegate.animatedProgress); | ||
804 | 172 | } | ||
805 | 173 | |||
806 | 123 | function test_tappingSwitchesFocusBetweenStages() { | 174 | function test_tappingSwitchesFocusBetweenStages() { |
807 | 124 | webbrowserCheckBox.checked = true; | 175 | webbrowserCheckBox.checked = true; |
808 | 125 | waitUntilAppSurfaceShowsUp(webbrowserCheckBox.appId); | 176 | waitUntilAppSurfaceShowsUp(webbrowserCheckBox.appId); |
809 | @@ -155,7 +206,6 @@ | |||
810 | 155 | tryCompare(webbrowserApp.session.surface, "activeFocus", false); | 206 | tryCompare(webbrowserApp.session.surface, "activeFocus", false); |
811 | 156 | } | 207 | } |
812 | 157 | 208 | ||
813 | 158 | |||
814 | 159 | function test_closeAppInSideStage() { | 209 | function test_closeAppInSideStage() { |
815 | 160 | dialerCheckBox.checked = true; | 210 | dialerCheckBox.checked = true; |
816 | 161 | waitUntilAppSurfaceShowsUp(dialerCheckBox.appId); | 211 | waitUntilAppSurfaceShowsUp(dialerCheckBox.appId); |
817 | @@ -200,6 +250,116 @@ | |||
818 | 200 | appWindow.width / 2, appWindow.height / 2, | 250 | appWindow.width / 2, appWindow.height / 2, |
819 | 201 | appWindow.width / 2, -appWindow.height / 2); | 251 | appWindow.width / 2, -appWindow.height / 2); |
820 | 202 | } | 252 | } |
821 | 253 | |||
822 | 254 | function test_suspendsAndResumesAppsInMainStage() { | ||
823 | 255 | webbrowserCheckBox.checked = true; | ||
824 | 256 | var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId); | ||
825 | 257 | compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage); | ||
826 | 258 | |||
827 | 259 | tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running); | ||
828 | 260 | |||
829 | 261 | galleryCheckBox.checked = true; | ||
830 | 262 | var galleryApp = ApplicationManager.findApplication(galleryCheckBox.appId); | ||
831 | 263 | compare(galleryApp.stage, ApplicationInfoInterface.MainStage); | ||
832 | 264 | |||
833 | 265 | tryCompare(galleryApp, "state", ApplicationInfoInterface.Running); | ||
834 | 266 | tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Suspended); | ||
835 | 267 | |||
836 | 268 | switchToApp(webbrowserApp.appId); | ||
837 | 269 | |||
838 | 270 | tryCompare(galleryApp, "state", ApplicationInfoInterface.Suspended); | ||
839 | 271 | tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running); | ||
840 | 272 | |||
841 | 273 | switchToApp(galleryApp.appId); | ||
842 | 274 | |||
843 | 275 | tryCompare(galleryApp, "state", ApplicationInfoInterface.Running); | ||
844 | 276 | tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Suspended); | ||
845 | 277 | } | ||
846 | 278 | |||
847 | 279 | |||
848 | 280 | function test_foregroundMainAndSideStageAppsAreKeptRunning() { | ||
849 | 281 | |||
850 | 282 | var stagesPriv = findInvisibleChild(tabletStage, "stagesPriv"); | ||
851 | 283 | verify(stagesPriv); | ||
852 | 284 | |||
853 | 285 | // launch two main stage apps | ||
854 | 286 | // gallery will be on foreground and webbrowser on background | ||
855 | 287 | |||
856 | 288 | webbrowserCheckBox.checked = true; | ||
857 | 289 | waitUntilAppSurfaceShowsUp(webbrowserCheckBox.appId) | ||
858 | 290 | var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId); | ||
859 | 291 | compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage); | ||
860 | 292 | |||
861 | 293 | galleryCheckBox.checked = true; | ||
862 | 294 | waitUntilAppSurfaceShowsUp(galleryCheckBox.appId) | ||
863 | 295 | var galleryApp = ApplicationManager.findApplication(galleryCheckBox.appId); | ||
864 | 296 | compare(galleryApp.stage, ApplicationInfoInterface.MainStage); | ||
865 | 297 | |||
866 | 298 | compare(stagesPriv.mainStageAppId, galleryCheckBox.appId); | ||
867 | 299 | |||
868 | 300 | // then launch two side stage apps | ||
869 | 301 | // facebook will be on foreground and dialer on background | ||
870 | 302 | |||
871 | 303 | dialerCheckBox.checked = true; | ||
872 | 304 | waitUntilAppSurfaceShowsUp(dialerCheckBox.appId) | ||
873 | 305 | var dialerApp = ApplicationManager.findApplication(dialerCheckBox.appId); | ||
874 | 306 | compare(dialerApp.stage, ApplicationInfoInterface.SideStage); | ||
875 | 307 | |||
876 | 308 | facebookCheckBox.checked = true; | ||
877 | 309 | waitUntilAppSurfaceShowsUp(facebookCheckBox.appId) | ||
878 | 310 | var facebookApp = ApplicationManager.findApplication(facebookCheckBox.appId); | ||
879 | 311 | compare(facebookApp.stage, ApplicationInfoInterface.SideStage); | ||
880 | 312 | |||
881 | 313 | compare(stagesPriv.sideStageAppId, facebookCheckBox.appId); | ||
882 | 314 | |||
883 | 315 | // Now check that the foreground apps are running and that the background ones | ||
884 | 316 | // are suspended | ||
885 | 317 | |||
886 | 318 | tryCompare(galleryApp, "state", ApplicationInfoInterface.Running); | ||
887 | 319 | tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Suspended); | ||
888 | 320 | tryCompare(facebookApp, "state", ApplicationInfoInterface.Running); | ||
889 | 321 | tryCompare(dialerApp, "state", ApplicationInfoInterface.Suspended); | ||
890 | 322 | |||
891 | 323 | switchToApp(dialerCheckBox.appId); | ||
892 | 324 | |||
893 | 325 | tryCompare(galleryApp, "state", ApplicationInfoInterface.Running); | ||
894 | 326 | tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Suspended); | ||
895 | 327 | tryCompare(facebookApp, "state", ApplicationInfoInterface.Suspended); | ||
896 | 328 | tryCompare(dialerApp, "state", ApplicationInfoInterface.Running); | ||
897 | 329 | |||
898 | 330 | switchToApp(webbrowserCheckBox.appId); | ||
899 | 331 | |||
900 | 332 | tryCompare(galleryApp, "state", ApplicationInfoInterface.Suspended); | ||
901 | 333 | tryCompare(webbrowserApp, "state", ApplicationInfoInterface.Running); | ||
902 | 334 | tryCompare(facebookApp, "state", ApplicationInfoInterface.Suspended); | ||
903 | 335 | tryCompare(dialerApp, "state", ApplicationInfoInterface.Running); | ||
904 | 336 | } | ||
905 | 337 | |||
906 | 338 | function test_foregroundAppsAreSuspendedWhenStageIsSuspended() { | ||
907 | 339 | webbrowserCheckBox.checked = true; | ||
908 | 340 | waitUntilAppSurfaceShowsUp(webbrowserCheckBox.appId) | ||
909 | 341 | var webbrowserApp = ApplicationManager.findApplication(webbrowserCheckBox.appId); | ||
910 | 342 | compare(webbrowserApp.stage, ApplicationInfoInterface.MainStage); | ||
911 | 343 | |||
912 | 344 | dialerCheckBox.checked = true; | ||
913 | 345 | waitUntilAppSurfaceShowsUp(dialerCheckBox.appId) | ||
914 | 346 | var dialerApp = ApplicationManager.findApplication(dialerCheckBox.appId); | ||
915 | 347 | compare(dialerApp.stage, ApplicationInfoInterface.SideStage); | ||
916 | 348 | |||
917 | 349 | |||
918 | 350 | compare(webbrowserApp.requestedState, ApplicationInfoInterface.RequestedRunning); | ||
919 | 351 | compare(dialerApp.requestedState, ApplicationInfoInterface.RequestedRunning); | ||
920 | 352 | |||
921 | 353 | tabletStage.suspended = true; | ||
922 | 354 | |||
923 | 355 | tryCompare(webbrowserApp, "requestedState", ApplicationInfoInterface.RequestedSuspended); | ||
924 | 356 | tryCompare(dialerApp, "requestedState", ApplicationInfoInterface.RequestedSuspended); | ||
925 | 357 | |||
926 | 358 | tabletStage.suspended = false; | ||
927 | 359 | |||
928 | 360 | tryCompare(webbrowserApp, "requestedState", ApplicationInfoInterface.RequestedRunning); | ||
929 | 361 | tryCompare(dialerApp, "requestedState", ApplicationInfoInterface.RequestedRunning); | ||
930 | 362 | } | ||
931 | 203 | } | 363 | } |
932 | 204 | 364 | ||
933 | 205 | } | 365 | } |
934 | 206 | 366 | ||
935 | === modified file 'tests/qmltests/tst_OrientedShell.qml' | |||
936 | --- tests/qmltests/tst_OrientedShell.qml 2015-07-10 14:44:55 +0000 | |||
937 | +++ tests/qmltests/tst_OrientedShell.qml 2015-08-03 14:21:12 +0000 | |||
938 | @@ -46,7 +46,7 @@ | |||
939 | 46 | } | 46 | } |
940 | 47 | 47 | ||
941 | 48 | QtObject { | 48 | QtObject { |
943 | 49 | id: mockUsageModeSettings | 49 | id: mockUnity8Settings |
944 | 50 | property string usageMode: usageModeSelector.model[usageModeSelector.selectedIndex] | 50 | property string usageMode: usageModeSelector.model[usageModeSelector.selectedIndex] |
945 | 51 | } | 51 | } |
946 | 52 | 52 | ||
947 | @@ -125,7 +125,7 @@ | |||
948 | 125 | sourceComponent: Component { | 125 | sourceComponent: Component { |
949 | 126 | OrientedShell { | 126 | OrientedShell { |
950 | 127 | anchors.fill: parent | 127 | anchors.fill: parent |
952 | 128 | usageModeSettings: mockUsageModeSettings | 128 | unity8Settings: mockUnity8Settings |
953 | 129 | oskSettings: mockOskSettings | 129 | oskSettings: mockOskSettings |
954 | 130 | physicalOrientation: root.physicalOrientation0 | 130 | physicalOrientation: root.physicalOrientation0 |
955 | 131 | orientationLocked: orientationLockedCheckBox.checked | 131 | orientationLocked: orientationLockedCheckBox.checked |
956 | @@ -926,7 +926,7 @@ | |||
957 | 926 | 926 | ||
958 | 927 | function test_attachRemoveInputDevices() { | 927 | function test_attachRemoveInputDevices() { |
959 | 928 | usageModeSelector.selectedIndex = 2; | 928 | usageModeSelector.selectedIndex = 2; |
961 | 929 | tryCompare(mockUsageModeSettings, "usageMode", "Automatic") | 929 | tryCompare(mockUnity8Settings, "usageMode", "Automatic") |
962 | 930 | 930 | ||
963 | 931 | loadShell("mako") | 931 | loadShell("mako") |
964 | 932 | var shell = findChild(orientedShell, "shell"); | 932 | var shell = findChild(orientedShell, "shell"); |
965 | 933 | 933 | ||
966 | === modified file 'tests/qmltests/tst_Shell.qml' | |||
967 | --- tests/qmltests/tst_Shell.qml 2015-07-29 12:38:53 +0000 | |||
968 | +++ tests/qmltests/tst_Shell.qml 2015-08-03 14:21:12 +0000 | |||
969 | @@ -67,11 +67,6 @@ | |||
970 | 67 | width: units.gu(40) | 67 | width: units.gu(40) |
971 | 68 | height: units.gu(71) | 68 | height: units.gu(71) |
972 | 69 | } | 69 | } |
973 | 70 | StateChangeScript { | ||
974 | 71 | script: { | ||
975 | 72 | GSettingsController.setUsageMode("Staged") | ||
976 | 73 | } | ||
977 | 74 | } | ||
978 | 75 | }, | 70 | }, |
979 | 76 | State { | 71 | State { |
980 | 77 | name: "tablet" | 72 | name: "tablet" |
981 | @@ -80,11 +75,6 @@ | |||
982 | 80 | width: units.gu(100) | 75 | width: units.gu(100) |
983 | 81 | height: units.gu(71) | 76 | height: units.gu(71) |
984 | 82 | } | 77 | } |
985 | 83 | StateChangeScript { | ||
986 | 84 | script: { | ||
987 | 85 | GSettingsController.setUsageMode("Staged") | ||
988 | 86 | } | ||
989 | 87 | } | ||
990 | 88 | }, | 78 | }, |
991 | 89 | State { | 79 | State { |
992 | 90 | name: "desktop" | 80 | name: "desktop" |
993 | @@ -97,11 +87,6 @@ | |||
994 | 97 | target: mouseEmulation | 87 | target: mouseEmulation |
995 | 98 | checked: false | 88 | checked: false |
996 | 99 | } | 89 | } |
997 | 100 | StateChangeScript { | ||
998 | 101 | script: { | ||
999 | 102 | GSettingsController.setUsageMode("Windowed") | ||
1000 | 103 | } | ||
1001 | 104 | } | ||
1002 | 105 | } | 90 | } |
1003 | 106 | ] | 91 | ] |
1004 | 107 | 92 | ||
1005 | @@ -317,7 +302,6 @@ | |||
1006 | 317 | mouseEmulation.checked = true; | 302 | mouseEmulation.checked = true; |
1007 | 318 | tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state | 303 | tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state |
1008 | 319 | tearDown(); | 304 | tearDown(); |
1009 | 320 | GSettingsController.setUsageMode("Staged"); | ||
1010 | 321 | } | 305 | } |
1011 | 322 | 306 | ||
1012 | 323 | function loadShell(formFactor) { | 307 | function loadShell(formFactor) { |
1013 | @@ -602,9 +586,9 @@ | |||
1014 | 602 | verify(mainAppId != ""); | 586 | verify(mainAppId != ""); |
1015 | 603 | var mainApp = ApplicationManager.findApplication(mainAppId); | 587 | var mainApp = ApplicationManager.findApplication(mainAppId); |
1016 | 604 | verify(mainApp); | 588 | verify(mainApp); |
1018 | 605 | tryCompare(mainApp, "state", ApplicationInfoInterface.Running); | 589 | tryCompare(mainApp, "requestedState", ApplicationInfoInterface.RequestedRunning); |
1019 | 606 | 590 | ||
1021 | 607 | // Suspend while call is active... | 591 | // Display off while call is active... |
1022 | 608 | callManager.foregroundCall = phoneCall; | 592 | callManager.foregroundCall = phoneCall; |
1023 | 609 | Powerd.status = Powerd.Off; | 593 | Powerd.status = Powerd.Off; |
1024 | 610 | tryCompare(greeter, "shown", false); | 594 | tryCompare(greeter, "shown", false); |
1025 | @@ -615,8 +599,7 @@ | |||
1026 | 615 | Powerd.status = Powerd.Off; | 599 | Powerd.status = Powerd.Off; |
1027 | 616 | tryCompare(greeter, "fullyShown", true); | 600 | tryCompare(greeter, "fullyShown", true); |
1028 | 617 | 601 | ||
1031 | 618 | tryCompare(ApplicationManager, "suspended", true); | 602 | compare(mainApp.requestedState, ApplicationInfoInterface.RequestedSuspended); |
1030 | 619 | compare(mainApp.state, ApplicationInfoInterface.Suspended); | ||
1032 | 620 | 603 | ||
1033 | 621 | // And wake up | 604 | // And wake up |
1034 | 622 | Powerd.status = Powerd.On; | 605 | Powerd.status = Powerd.On; |
1035 | @@ -632,8 +615,7 @@ | |||
1036 | 632 | removeTimeConstraintsFromDirectionalDragAreas(greeter); | 615 | removeTimeConstraintsFromDirectionalDragAreas(greeter); |
1037 | 633 | swipeAwayGreeter(); | 616 | swipeAwayGreeter(); |
1038 | 634 | 617 | ||
1041 | 635 | tryCompare(ApplicationManager, "suspended", false); | 618 | compare(mainApp.requestedState, ApplicationInfoInterface.RequestedRunning); |
1040 | 636 | compare(mainApp.state, ApplicationInfoInterface.Running); | ||
1042 | 637 | tryCompare(ApplicationManager, "focusedApplicationId", mainAppId); | 619 | tryCompare(ApplicationManager, "focusedApplicationId", mainAppId); |
1043 | 638 | } | 620 | } |
1044 | 639 | 621 | ||
1045 | @@ -804,15 +786,15 @@ | |||
1046 | 804 | 786 | ||
1047 | 805 | function test_launchedAppHasActiveFocus_data() { | 787 | function test_launchedAppHasActiveFocus_data() { |
1048 | 806 | return [ | 788 | return [ |
1052 | 807 | {tag: "phone", formFactor: "phone", usageMode: "Staged"}, | 789 | {tag: "phone", formFactor: "phone", usageScenario: "phone"}, |
1053 | 808 | {tag: "tablet", formFactor: "tablet", usageMode: "Staged"}, | 790 | {tag: "tablet", formFactor: "tablet", usageScenario: "tablet"}, |
1054 | 809 | {tag: "desktop", formFactor: "tablet", usageMode: "Windowed"} | 791 | {tag: "desktop", formFactor: "tablet", usageScenario: "desktop"} |
1055 | 810 | ] | 792 | ] |
1056 | 811 | } | 793 | } |
1057 | 812 | 794 | ||
1058 | 813 | function test_launchedAppHasActiveFocus(data) { | 795 | function test_launchedAppHasActiveFocus(data) { |
1059 | 814 | GSettingsController.setUsageMode(data.usageMode); | ||
1060 | 815 | loadShell(data.formFactor); | 796 | loadShell(data.formFactor); |
1061 | 797 | shell.usageScenario = data.usageScenario; | ||
1062 | 816 | swipeAwayGreeter(); | 798 | swipeAwayGreeter(); |
1063 | 817 | 799 | ||
1064 | 818 | var webApp = ApplicationManager.startApplication("webbrowser-app"); | 800 | var webApp = ApplicationManager.startApplication("webbrowser-app"); |
1065 | @@ -1347,6 +1329,50 @@ | |||
1066 | 1347 | compare(launcher.inverted, data.launcherInverted); | 1329 | compare(launcher.inverted, data.launcherInverted); |
1067 | 1348 | } | 1330 | } |
1068 | 1349 | 1331 | ||
1069 | 1332 | function test_unfocusedAppsGetSuspendedAfterEnteringStagedMode() { | ||
1070 | 1333 | loadShell("tablet"); | ||
1071 | 1334 | shell.usageScenario = "desktop"; | ||
1072 | 1335 | |||
1073 | 1336 | var webBrowserApp = ApplicationManager.startApplication("webbrowser-app"); | ||
1074 | 1337 | waitUntilAppWindowIsFullyLoaded(webBrowserApp); | ||
1075 | 1338 | |||
1076 | 1339 | var galleryApp = ApplicationManager.startApplication("gallery-app"); | ||
1077 | 1340 | waitUntilAppWindowIsFullyLoaded(galleryApp); | ||
1078 | 1341 | |||
1079 | 1342 | ApplicationManager.requestFocusApplication("unity8-dash"); | ||
1080 | 1343 | tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash"); | ||
1081 | 1344 | |||
1082 | 1345 | compare(webBrowserApp.requestedState, ApplicationInfoInterface.RequestedRunning); | ||
1083 | 1346 | compare(galleryApp.requestedState, ApplicationInfoInterface.RequestedRunning); | ||
1084 | 1347 | |||
1085 | 1348 | shell.usageScenario = "tablet"; | ||
1086 | 1349 | |||
1087 | 1350 | tryCompare(webBrowserApp, "requestedState", ApplicationInfoInterface.RequestedSuspended); | ||
1088 | 1351 | tryCompare(galleryApp, "requestedState", ApplicationInfoInterface.RequestedSuspended); | ||
1089 | 1352 | } | ||
1090 | 1353 | |||
1091 | 1354 | function test_unfocusedAppsAreResumedWhenEnteringWindowedMode() { | ||
1092 | 1355 | loadShell("tablet"); | ||
1093 | 1356 | shell.usageScenario = "tablet"; | ||
1094 | 1357 | |||
1095 | 1358 | var webBrowserApp = ApplicationManager.startApplication("webbrowser-app"); | ||
1096 | 1359 | waitUntilAppWindowIsFullyLoaded(webBrowserApp); | ||
1097 | 1360 | |||
1098 | 1361 | var galleryApp = ApplicationManager.startApplication("gallery-app"); | ||
1099 | 1362 | waitUntilAppWindowIsFullyLoaded(galleryApp); | ||
1100 | 1363 | |||
1101 | 1364 | ApplicationManager.requestFocusApplication("unity8-dash"); | ||
1102 | 1365 | tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash"); | ||
1103 | 1366 | |||
1104 | 1367 | compare(webBrowserApp.requestedState, ApplicationInfoInterface.RequestedSuspended); | ||
1105 | 1368 | compare(galleryApp.requestedState, ApplicationInfoInterface.RequestedSuspended); | ||
1106 | 1369 | |||
1107 | 1370 | shell.usageScenario = "desktop"; | ||
1108 | 1371 | |||
1109 | 1372 | tryCompare(webBrowserApp, "requestedState", ApplicationInfoInterface.RequestedRunning); | ||
1110 | 1373 | tryCompare(galleryApp, "requestedState", ApplicationInfoInterface.RequestedRunning); | ||
1111 | 1374 | } | ||
1112 | 1375 | |||
1113 | 1350 | function test_altTabSwitchesFocus() { | 1376 | function test_altTabSwitchesFocus() { |
1114 | 1351 | loadShell("desktop"); | 1377 | loadShell("desktop"); |
1115 | 1352 | shell.usageScenario = "desktop" | 1378 | shell.usageScenario = "desktop" |
FAILED: Continuous integration, rev:1771 jenkins. qa.ubuntu. com/job/ unity8- ci/5694/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 2692/console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- vivid/859/ console jenkins. qa.ubuntu. com/job/ unity8- vivid-amd64- ci/859/ console jenkins. qa.ubuntu. com/job/ unity8- vivid-i386- ci/860/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 2690/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/5694/ rebuild
http://